- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2616 Articles for Java
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
379 Views
You need to use port number 3306 in the URL. The syntax is as follows −jdbc:mysql://localhost:3306Exampleimport java.sql.Connection; import java.sql.DriverManager; public class MySQLConnectionToJava { public static void main(String[] args) { String JDBCURL="jdbc:mysql://localhost:3306/sample?useSSL=false"; Connection con=null; try { con = DriverManager.getConnection(JDBCURL,"root","123456"); if(con!=null) { System.out.println("MySQL connection is successful with port 3306."); } } catch(Exception e) { e.printStackTrace(); } } }OutputMySQL connection is successful with port 3306.
![Adiya Dua](https://www.tutorialspoint.com/articles/images/user_icon.png)
457 Views
This Question comes to many professionals who are not actually into core technical and want to pursue their career in Selenium Automation. The term coding makes the non-programmers a bit scare to even start off with something like automation. There is a perception that a non-programmer cannot excel in Automation, but it is only in head. Many deserving and capable manual testers shy away from Selenium just thinking that it require some special skills.There are various many languages in which Selenium Scripts are designed such as Python, Ruby, C#, JavaScript and Java is one such of them. Knowing the popularity ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
290 Views
For this, use ResultSetMetaData. Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentFirstName varchar(20), -> StudentLastName varchar(20) -> ); Query OK, 0 rows affected (0.58 sec)The Java code is as follows −Exampleimport java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import com.mysql.jdbc.ResultSetMetaData; public class ResultSetDemo { public static void main(String[] args) { Connection con = null; PreparedStatement ps = null; Statement st = null; ResultSet rs = null; ... Read More
![Mahesh Parahar](https://www.tutorialspoint.com/assets/profiles/127878/profile/60_2277600-1655382864.jpg)
296 Views
GoGo is a procedural programming language. Programs are assembled using packages. It supports environment adopting patterns similar to dynamic languages.JavaJava is an object oriented programming language. Java is quiet fast, reliable and secure. It is most widely used language as well.Following are the important differences between Go and Java.Sr. No.KeyGoJava1TypeGo is a procedural programming language and supports patterns similar to dynamic languages.Java is an object oriented programming language.2Supports for ClassGo has no support for class with constructors.Java has support for class with constructors.3Exception HandlingGo has error handling instead of exception handling.Java has exception handling.4InheritanceGo has no support for inheritance.Java supports ... Read More
![Mahesh Parahar](https://www.tutorialspoint.com/assets/profiles/127878/profile/60_2277600-1655382864.jpg)
7K+ Views
AssociationAssociation in terms of objects refers to "has a" relationship between two related objects. For example, a employee has a communication address.class Employee { String name; Address communicationAddress; } class Address { String address; }AggregationAggregation in terms of objects refers to "has a"+ relationship between two related objects. For example, a department has multiple employees. It refers to having a collection of child objects in parent class. For example:class Department { String name; List employees; } class Employee { String name; }Sr. No.KeyAssociationAggregation1DefinitionAssociation refers to "has a" relationship between two classes which use each ... Read More
![Mahesh Parahar](https://www.tutorialspoint.com/assets/profiles/127878/profile/60_2277600-1655382864.jpg)
911 Views
All of these functions are used to get character from input and each function returns an integer signifying the status code as well.Following are the important differences between getc(), getchar(), getch() and getche() functions.getc()getc() can read characters from any stream. Returns EOF on failure.Syntaxint getc(FILE *stream);getchar()getchar() can read characters from standard input only.Syntaxint getchar();getch()getch() can read characters from standard input but it does not use any buffer and returns immidately without waiting for enter key pressed.Syntaxint getch();getche()getche() behaves similar to getch() as it can read characters from standard input and it does not use any buffer and returns immidately without ... Read More
![Mahesh Parahar](https://www.tutorialspoint.com/assets/profiles/127878/profile/60_2277600-1655382864.jpg)
23K+ Views
Both ArrayList and LinkedList are implementation of List interface in Java. Both classes are non-synchronized. But there are certain differences as well. Following are the important differences between ArrayList and LinkedList method. Sr. No. Key ArrayList LinkedList 1 Internal Implementation ArrayList internally uses a dynamic array to store its elements. LinkedList uses Doubly Linked List to store its elements. 2 Manipulation ArrayList is slow as array manipulation is slower. LinkedList is faster being node based as not much bit shifting required. 3 Implementation ArrayList implements only List. LinkedList implements List as well as Queue. It can acts as a queue as well. 4 Access ArrayList is faster in storing and accessing data. LinkedList is faster in manipulation of data. Example of ArrayList ... Read More
![Mahesh Parahar](https://www.tutorialspoint.com/assets/profiles/127878/profile/60_2277600-1655382864.jpg)
20K+ Views
Class A class is a blueprint from which individual objects are created. A class can contain any of the following variable types. Local Variables − Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and the variable will be destroyed when the method has completed. Instance Variables − Instance variables are variables within a class but outside any method. These variables are initialized when the class is instantiated. Instance variables can be accessed from inside any method, constructor or blocks of that particular class. Class Variables − Class variables are variables declared ... Read More
![Mahesh Parahar](https://www.tutorialspoint.com/assets/profiles/127878/profile/60_2277600-1655382864.jpg)
19K+ Views
Constructors are special methods used to initialize objects whereas methods are used to execute certain statements. Following are the important differences between Constructors and Methods. Sr. No. Key Constructors Methods 1 Purpose Constructor is used to create and initialize an Object. Method is used to execute certain statements. 2 Invocation A constructor is invoked implicitly by the System. A method is to be invoked during program code. 3 Invocation A constructor is invoked when new keyword is used to create an object. A method is invoked when it is called. 4 Return Type A constructor can not have any return type. A method can have a return type. 5 Object A constructor initializes an object which is not existent. A method can be invoked ... Read More
![Mahesh Parahar](https://www.tutorialspoint.com/assets/profiles/127878/profile/60_2277600-1655382864.jpg)
10K+ Views
Scanner and BufferReader both classes are used to read input from external system. Scanner is normally used when we know input is of type string or of primitive types and BufferReader is used to read text from character streams while buffering the characters for efficient reading of characters. Following are the important differences between Scanner class and a BufferReader class.Sr. No.KeyScanner ClassBufferReader Class1SynchronousScanner is not syncronous in nature and should be used only in single threaded case.BufferReader is syncronous in nature. During multithreading environment, BufferReader should be used.2Buffer MemoryScanner has little buffer of 1 KB char buffer.BufferReader has large buffer ... Read More