Trending questions in Java

+8 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
148,908 views
+15 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, 2019 in Java by Suresh
• 700 points
103,925 views
+2 votes
10 answers

How to import a jar file in Eclipse?

To import jar file in your Eclipse ...READ MORE

May 15, 2018 in Java by sharth
• 3,370 points
87,088 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, 2019 in Java by Neha
• 330 points
70,232 views
+9 votes
12 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,560 points
57,328 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, 2019 in Java by Encrypter Manyange
38,426 views
+1 vote
11 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
33,049 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
36,484 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, 2019 in Java by Jim
• 810 points

reshown Jun 17, 2019 by Vardhan 30,875 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
29,561 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
24,914 views
+2 votes
1 answer

please someone tell the code to launch an instance in digital ocean using java

In order to create a digital ocean ...READ MORE

6 days ago in Java by Sirajul
• 44,960 points
44 views
+1 vote
1 answer

Program for nth prime number without using scanner

Hi @Sneha, you could use something like ...READ MORE

Jan 13 in Java by Kalgi
• 49,700 points
41 views
+1 vote
0 answers

I am getting below error "The method readerFor(Class<Map>) is undefined for the type CsvMapper"

I Have requirement to convert csv to ...READ MORE

Dec 29, 2019 in Java by anonymous
• 160 points
101 views
+1 vote
0 answers

getting below error when trying to conver csv file to json :The method readerFor(Class<Map>) is undefined for the type CsvMapper [closed]

PFB source code: import java.io.File; import java.lang.*; import java.util.Arrays; import java.util.List; import ...READ MORE

Dec 28, 2019 in Java by anonymous
• 160 points

closed 6 days ago by Kalgi 88 views
+1 vote
1 answer

Is Java a compiled language or interpreted?

Compiled languages are directly converted into machine ...READ MORE

Dec 18, 2019 in Java by Hannah
• 17,380 points
119 views
+1 vote
1 answer

how to print this statement in java print(' '*(r-x-1)+'*'*(2*x+1)) ( logic used in python .its perfect) but java wrong output came

In ' '*(r-x-1) and '*'*(2*x+1), you used multiplication ...READ MORE

Dec 21, 2019 in Java by Utsab Bandyopadhyay
170 views
0 votes
0 answers

Provider class org.eclipse.jetty.http.Http1FieldPreEncoder not in module

I imported jars such as selenium server ...READ MORE

Dec 10, 2019 in Java by Haider
• 120 points
192 views
0 votes
10 answers

Java - sending HTTP parameters via POST method easily

I personally use Apache's HTTPClient/HttpCore libraries to do ...READ MORE

Dec 10, 2018 in Java by robocop
19,016 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, 2019 in Java by Priyaj
• 57,450 points
11,249 views
0 votes
0 answers

java regex split string into double numbers and-letters

I am having a problem splitting something ...READ MORE

Nov 14, 2019 in Java by khs
• 120 points
182 views
+1 vote
2 answers

Java: Nested Methods

public class ObjClass {     ObjClass anyMethod() ...READ MORE

1 day ago in Java by zemiak
502 views
0 votes
0 answers

pass datasource for job to AWS Glue client in JAVA

How can i mention datasource for AWS ...READ MORE

Nov 9, 2019 in Java by cheshta
• 120 points
111 views
0 votes
1 answer

HttpServletRequest get JSON POST data

Normally you can GET and POST parameters ...READ MORE

Nov 29, 2018 in Java by Sushmita
• 6,880 points
14,884 views
+2 votes
2 answers

Using while loop i want to print 10 even numbers

public class Loops { ...READ MORE

Dec 4, 2019 in Java by One of the Simplest ways to answer you q
6,669 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, 2019 in Java by Sirajul
• 44,960 points
3,348 views
+1 vote
0 answers

output occurs but invisible immediately how to rectify this ?

public class evenodd { public static void main(String[] ...READ MORE

Oct 17, 2019 in Java by BIPLAB
• 130 points
166 views
+1 vote
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, 2019 in Java by Sirajul
• 44,960 points
5,516 views
0 votes
1 answer

Java and MySql: Check if database exists

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

Sep 30, 2019 in Java by Tina
159 views
0 votes
1 answer

Java and MySql: Delete database if exists

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

Sep 30, 2019 in Java by Kiran
145 views
0 votes
1 answer

How to connect Java to MySql Database?

Make sure you have the MySQL jdbc ...READ MORE

Sep 30, 2019 in Java by Shyam
114 views
0 votes
1 answer

How to create database in MySql using Java?

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

Sep 30, 2019 in Java by Shri
101 views
0 votes
1 answer

How can I solve this example in an easy way??

You can use this code: import java.util.*; public class ...READ MORE

Sep 23, 2019 in Java by Omkar
• 68,840 points
71 views
+1 vote
4 answers

What is difference between access modifier and access specifier in java

Access Specifier:- This can be understood as ...READ MORE

Feb 14, 2019 in Java by Priyaj
• 57,450 points
9,017 views
0 votes
0 answers

why the should be final

Sep 17, 2019 in Java by anonymous
61 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, 2019 in Java by Piya
109 views
+1 vote
1 answer

Adding Jar file to project

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

Sep 4, 2019 in Java by Esha
116 views
+2 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, 2019 in Java by avishek
• 140 points
3,136 views
0 votes
1 answer

Java and MySql: Check if database exists

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

Aug 27, 2019 in Java by Kunal
272 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, 2019 in Java by Sirajul
• 44,960 points
2,115 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, 2019 in Java by Kishan
449 views
0 votes
1 answer

How to connect Java to MySql Database?

This will work: try { ...READ MORE

Aug 27, 2019 in Java by John
87 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, 2019 in Java by Jishan
61 views
0 votes
1 answer

Java and MySql: Delete database if exists

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

Aug 27, 2019 in Java by Varun
58 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, 2019 in Java by sampriti
• 1,100 points
830 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, 2019 in Java by Nila
52 views
0 votes
1 answer

How to create database in MySql using Java?

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

Aug 27, 2019 in Java by Juni
52 views