Trending questions in Java

+7 votes
11 answers

Default parameters of XMS and XMX in JVM

You use these Java command-line parameters to ...READ MORE

Nov 13, 2018 in Java by Murali
100,092 views
+14 votes
18 answers

How can I convert String to JSON object in Java?

Hi @Daisy You can use Google gson  for more ...READ MORE

Feb 7 in Java by Suresh
• 700 points
77,130 views
+2 votes
12 answers

“A Non-static method cannot be referenced from a static context” error

this method must be static so that it will exist even though the ...READ MORE

Jun 11 in Java by Neha
• 330 points
45,967 views
+2 votes
10 answers

How to import a jar file in Eclipse?

Go to your project right click and ...READ MORE

Dec 10, 2018 in Java by Hola77
50,120 views
+9 votes
11 answers

Unable to resolve this error: "javac is not recognized as an internal or external command"

Check your javac path on Windows using Windows Explorer C:\Program Files\Java\jdk1.7.0_02\bin and ...READ MORE

May 23, 2018 in Java by Rishabh
• 3,540 points
30,620 views
+1 vote
11 answers

Communications link failure: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

you mysql server instance is not running ...READ MORE

Jun 15 in Java by Encrypter Manyange
20,444 views
+1 vote
11 answers

How to send HTTP POST requests on Java?

How to invoke Thread dump analysis API? Invoking ...READ MORE

Jun 16 in Java by Jim
• 810 points

reshown Jun 17 by Vardhan 17,683 views
+2 votes
10 answers

Unable to execute jar- file: “no main manifest attribute”

add a jar/manifest/attributes setting like this: apply plugin: ...READ MORE

Nov 27, 2018 in Java by krishti
21,186 views
0 votes
10 answers

What is the correct way to add external Jars to IntelliJ IDEA Project?

The best way is to add the ...READ MORE

Dec 10, 2018 in Java by Nabarupa
17,515 views
+1 vote
10 answers

How does java.net.SocketException: Connection reset happen ?

You can use wireshark to view the ...READ MORE

Dec 7, 2018 in Java by tushh
15,801 views
0 votes
1 answer

What is the difference between main(String[] args) and main(String... args) in Java?

String[] is used to accept a single parameter ...READ MORE

Sep 6 in Java by Piya
22 views
+1 vote
1 answer

Adding Jar file to project

Changing the JRE System Library might work.  Right-click ...READ MORE

Sep 4 in Java by Esha
23 views
0 votes
1 answer

Java and MySql: Check if database exists

You can get the list of databases ...READ MORE

Aug 27 in Java by Kunal
27 views
0 votes
1 answer

How to connect Java to MySql Database?

This will work: try { ...READ MORE

Aug 27 in Java by John
27 views
0 votes
1 answer

How to get text from text box in Swing?

You can add a Button listener here. ...READ MORE

Aug 27 in Java by Jishan
21 views
0 votes
1 answer

How to create password field in Swing?

Swing provides an object called JPasswordField for ...READ MORE

Aug 27 in Java by Bruce
19 views
0 votes
1 answer

How to create text labels in Swing, Java?

In the frame, you can use the ...READ MORE

Aug 27 in Java by Jimmy
16 views
0 votes
1 answer

Java and MySql: Delete database if exists

First, you have to check if the ...READ MORE

Aug 27 in Java by Varun
16 views
0 votes
1 answer

Handling empty input in swing text box

login_but.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ //System.out.print(F_user.getText()); String username ...READ MORE

Aug 27 in Java by Nila
14 views
0 votes
1 answer

How to create database in MySql using Java?

First, you will have to create connection ...READ MORE

Aug 27 in Java by Juni
13 views
0 votes
1 answer

Create Buttons in Java Swing

First, you will have to create a ...READ MORE

Aug 27 in Java by Esha
12 views
0 votes
1 answer

Swing Java create Text Box

In the frame, you can use the ...READ MORE

Aug 27 in Java by Kyle
12 views
0 votes
1 answer

How to Convert .msg (outlook mail) to pdf using java

Hi @Basha! Here's a code to help you ...READ MORE

Aug 21 in Java by Kishan
82 views
0 votes
1 answer
0 votes
0 answers

How to run python script in java [closed]

Aug 22 in Java by anonymous

closed Aug 22 by Omkar 26 views
+1 vote
1 answer

Java: Nested Methods

JAVA does not support “directly” nested methods, but you ...READ MORE

Aug 20 in Java by Sirajul
• 25,180 points
35 views
0 votes
1 answer

How to find the nth prime number in Java?

Here is the code to find nth ...READ MORE

Mar 4 in Java by Priyaj
• 56,520 points
7,361 views
0 votes
2 answers

How do I get distinct element from list in java?

You should use a Set. it doesn't contain duplicates. If ...READ MORE

Aug 23 in Java by Sirajul
• 25,180 points
38 views
0 votes
2 answers

Please explain me the difference between scanner and the buffer reader?

As per your question for reading a ...READ MORE

Aug 27 in Java by Sirajul
• 25,180 points
34 views
0 votes
2 answers

Can you give me the proper difference between java.util.Date vs java.sql.Date ?

The java.util.date class represents a particular moment in time, with ...READ MORE

Aug 27 in Java by Sirajul
• 25,180 points
35 views
0 votes
1 answer

Can you explain what is the difference between hashtable and hashmap?

Hi, Hashtable is synchronized, whereas HashMap is not. This makes HashMap better for ...READ MORE

Aug 14 in Java by anonymous
39 views
+1 vote
10 answers

Iterate over a JSONObject?

You can use the following method to ...READ MORE

Dec 7, 2018 in Java by Shuvodip
13,891 views
0 votes
1 answer

How to add items in list at a time?

Hi Priyanka , I think this code snippet ...READ MORE

Aug 9 in Java by sampriti
• 1,100 points
124 views
+2 votes
1 answer

Javac command not working in my windows 10

Check your javac path on Windows using Windows Explorer C:\Program Files\Java\jdk1.7.0_02\bin and ...READ MORE

Aug 6 in Java by Sirajul
• 25,180 points
130 views
+2 votes
0 answers

How to add external Jar in modular JavaFX 11 project correctly?

I'm using Java 11 and JavaFX 11. ...READ MORE

Aug 8 in Java by invzbl3
75 views
0 votes
1 answer

How can I change my string into date directly?

Hi Priya, You check this code, import java.util.Date; import java.text.DateFormat; import ...READ MORE

Aug 9 in Java by sampriti
• 1,100 points
20 views
0 votes
1 answer

how to compare two words in java?

hey,  I think in your code the function ...READ MORE

Aug 7 in Java by sampriti
• 1,100 points

edited Aug 8 by Kalgi 104 views
0 votes
1 answer

which maven dependency has to be added for MongoPreparedStatement in java 1.8

You need to define the dependency of a ...READ MORE

Jul 30 in Java by Sirajul
• 25,180 points
32 views
0 votes
2 answers

What is the difference between Map and HashMap in java?

The basic difference is : Map is ...READ MORE

Aug 28 in Java by Sirajul
• 25,180 points
157 views
0 votes
2 answers

How to take multiple integer input in one line using BufferedReader in Java?

Try this in case you don't know ...READ MORE

Aug 29 in Java by Sirajul
• 25,180 points
1,906 views
0 votes
1 answer

What is Comparable in Java?

As the name itself suggests, Comparable is an interface which defines ...READ MORE

Jul 15 in Java by Neha
• 6,280 points
38 views
0 votes
1 answer

What is Just in time compiler in Java?

The Just-In-Time compiler is one of the integral parts ...READ MORE

Jul 14 in Java by Frankie
• 9,810 points
31 views
0 votes
1 answer

What do you mean by Socket Programming?

Socket programming is a way of connecting two ...READ MORE

Jul 14 in Java by Frankie
• 9,810 points
24 views
0 votes
0 answers

How to pass dynamic JSON request with parameter in POST request using Rest assured java?

I am currently testing an API which ...READ MORE

Jun 25 in Java by avishek
• 120 points
606 views
+1 vote
0 answers

Initially autowired object has value,it becomes null after paging(using JSF 2.2 and spring 4.01.)

i'm trying to create basic crud operations ...READ MORE

Jul 5 in Java by swats
70 views
0 votes
1 answer

i am getting sessionnotcreatedexception in appium

Hi... it says here that Appium cannot ...READ MORE

Jun 27 in Java by ajs3033
• 7,280 points
46 views
+1 vote
1 answer

Can you please explain the difference between string, string buffer and string builder?

String are immutable where as StringBuffer and ...READ MORE

Jul 4 in Java by Akash
• 160 points
66 views