Most viewed questions in Java

0 votes
2 answers

What is the use of toString method in Java and how can I use it ?

Whenever you require to explore the constructor ...READ MORE

Aug 23, 2018 in Java by Daisy
• 8,120 points
3,804 views
0 votes
2 answers

How to parse/format dates with LocalDateTime? (Java 8)

Converting LocalDateTime to Time Zone ISO8601 String LocalDateTime ...READ MORE

Dec 6, 2018 in Java by Sushmita
• 6,910 points
3,798 views
0 votes
0 answers

Java 11 JDK for Windows 7 32-bit system

I wanted to install Java 11 on ...READ MORE

Apr 21, 2022 in Java by Rahul
• 3,380 points
3,773 views
0 votes
1 answer

DEX decompilation in Java Sourcecode

down voteaccep It's easy Get these tools: 1) dex2jar to translate dex ...READ MORE

Jun 29, 2018 in Java by Rishabh
• 3,620 points
3,737 views
0 votes
1 answer

How to include SQLite database in executable Jar?

Hello @kartik, I have found two different ways ...READ MORE

May 8, 2020 in Java by Niroj
• 82,880 points
3,725 views
0 votes
3 answers

How to parse JSON in Java

import org.json.*; JSONObject obj = new JSONObject(" .... ...READ MORE

Aug 20, 2018 in Java by Daisy
• 8,120 points
3,725 views
0 votes
1 answer

What are the advantages of Dynamic Polymorphism?

Advantages of Dynamic Polymorphism Dynamic Polymorphism allows Java ...READ MORE

Feb 1, 2019 in Java by Frankie
• 9,830 points
3,702 views
0 votes
1 answer

How to set path if java is installed in E drive or D drive rather than c

Hello, @Amazing, It doesn't really matter where you ...READ MORE

Sep 1, 2020 in Java by Roshni
• 10,520 points

edited Jul 4, 2023 by Khan Sarfaraz 3,673 views
0 votes
1 answer

How can we compare objects by multiple fields in Java?

You can implement a Comparator which compares two Person objects, and ...READ MORE

Jan 9, 2019 in Java by Daisy
• 8,120 points
3,659 views
0 votes
1 answer

Under what conditions is a JSESSIONID created?

JSESSIONID cookie is created/sent when session is ...READ MORE

Dec 18, 2018 in Java by Daisy
• 8,120 points
3,649 views
+1 vote
2 answers

What are inner classes and static nested classes?

Nested classes are divided into two categories: ...READ MORE

Dec 3, 2018 in Java by Sushmita
• 6,910 points
3,636 views
0 votes
1 answer

web.xml file is missing in my eclipse IDE

Very simple. You will find Deployment Descriptor ...READ MORE

Nov 27, 2018 in Java by Omkar
• 69,210 points
3,629 views
0 votes
1 answer

Javascript require() function giving ReferenceError: require is not defined

RequireJS is a JavaScript file and module ...READ MORE

Feb 17, 2022 in Java by Aditya
• 7,680 points
3,628 views
0 votes
1 answer

Http Basic Authentication in Java using HttpClient?

String encoding = Base64Encoder.encode ("test1:test1"); HttpPost httppost = ...READ MORE

Dec 20, 2018 in Java by Daisy
• 8,120 points
3,621 views
0 votes
1 answer

How can we remove html tags from a string?

You can use HTML parser. This is ...READ MORE

Jun 4, 2018 in Java by sophia
• 1,400 points
3,615 views
0 votes
1 answer

Implementing mouseover() function in Selenium webdriver

This code works perfectly well: Actions builder ...READ MORE

Jan 22, 2019 in Java by developer_1
• 3,320 points
3,610 views
0 votes
3 answers

How to check whether a file exists or not in Java?

Using nio we can check whether file ...READ MORE

Aug 14, 2018 in Java by Sushmita
• 6,910 points
3,582 views
0 votes
1 answer

Use Servlets with Ajax

Here, we are going to create the ...READ MORE

Jul 16, 2018 in Java by Akrati
• 3,190 points
3,578 views
0 votes
1 answer

Error:jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Hello @kartik, The servlet API .jar file must ...READ MORE

Jun 3, 2020 in Java by Niroj
• 82,880 points
3,539 views
0 votes
0 answers

How to run python script in java [closed]

Aug 22, 2019 in Java by anonymous

closed Aug 22, 2019 by Omkar 3,497 views
0 votes
1 answer

how to read csv file form sftp connection and store into string object in java code and convert into json.....post it using rest api

Hey, @Pooja, Before starting with anything you should ...READ MORE

May 13, 2020 in Java by Roshni
• 10,520 points
3,496 views
0 votes
2 answers

What's the best way to check if a String represents an integer in Java?

You can also use regular expression. str.matches("-?\\d+"); It will ...READ MORE

Aug 9, 2018 in Java by Daisy
• 8,120 points
3,470 views
0 votes
1 answer

Error:Maven Unable to locate the Javac Compiler in:

Hello @kartik, Go to Window -> Preferences... -> ...READ MORE

Jun 3, 2020 in Java by Niroj
• 82,880 points
3,463 views
+1 vote
1 answer

How can I find memory usage of my application in Android?

You can get memory info programmatically and ...READ MORE

Jan 10, 2019 in Java by Sushmita
• 6,910 points
3,456 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
3,447 views
0 votes
1 answer

Good Hash Function for Strings

Usually hashes wouldn't do sums, otherwise, stop and pots will have ...READ MORE

Jul 19, 2018 in Java by Akrati
• 960 points
3,447 views
0 votes
1 answer

Dagger error in Java

What's going on? Have a good look at ...READ MORE

Feb 11, 2019 in Java by developer_1
• 3,320 points
3,438 views
0 votes
1 answer

How can we set environment variables from java?

For setting the environment variable, you can ...READ MORE

Jun 21, 2018 in Java by Akrati
• 960 points
3,436 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, 2019 in Java by Sirajul
• 59,230 points
3,432 views
0 votes
1 answer

Violation Long running JavaScript task took xx ms

These messages are classified as warnings rather ...READ MORE

Nov 15, 2022 in Java by Damonlang
• 1,230 points
3,431 views
0 votes
1 answer

How to filter an array from all elements of another array

This is what I would do: var arr1 = [1,2,3,4], ...READ MORE

Nov 7, 2022 in Java by Damonlang
• 700 points
3,430 views
+1 vote
2 answers

Can I convert my Java program to an .exe file?

Launch4j is a cross-platform tool for wrapping ...READ MORE

Oct 18, 2018 in Java by Sushmita
• 6,910 points
3,413 views
0 votes
3 answers

Check if a String is numeric in Java

Java 8 Lambda Expression is used: String someString ...READ MORE

Sep 3, 2018 in Java by Daisy
• 8,120 points
3,379 views
+1 vote
1 answer

Performance difference of if/else vs switch statement in Java

The thing you are worried about is ...READ MORE

Jul 26, 2018 in Java by geek.erkami
• 2,680 points
3,373 views
0 votes
2 answers

How do I convert an input stream into a byte array

You could probably try this if you ...READ MORE

Aug 29, 2019 in Java by Sirajul
• 59,230 points
3,371 views
0 votes
1 answer

How to get the current working directory in Java?

Hello, Using java.nio.file.Path and java.nio.file.Paths, you can do the following to ...READ MORE

May 28, 2020 in Java by Niroj
• 82,880 points
3,351 views
0 votes
1 answer

@Component vs @Repository vs @Service in Spring Framework

As you might be knowing, all these ...READ MORE

May 29, 2018 in Java by geek.erkami
• 2,680 points
3,333 views
0 votes
1 answer

@RequestMapping annotation in Java Spring

The @RequestMapping annotation in Spring Framework is ...READ MORE

Sep 12, 2018 in Java by code.reaper12
• 3,500 points
3,272 views
0 votes
1 answer

What is the equivalent to a JavaScript setInterval/setTimeout in Android/Java?

Hii @kartik, As always with Android there's lots ...READ MORE

May 26, 2020 in Java by Niroj
• 82,880 points
3,195 views
0 votes
1 answer

Sending Email in Android using JavaMail API without using the default/built-in app

Send e-mail in Android using the JavaMail ...READ MORE

Dec 4, 2018 in Java by Daisy
• 8,120 points
3,187 views
+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

Jul 25, 2018 in Java by samarth295
• 2,220 points
3,176 views
0 votes
1 answer

What is @ModelAttribute in Spring MVC?

@ModelAttribute refers to a property of the ...READ MORE

Dec 18, 2018 in Java by Daisy
• 8,120 points
3,170 views
0 votes
1 answer

Get parameters from the URL with JSP

To delete the subject record with its ...READ MORE

May 29, 2018 in Java by Parth
• 4,630 points
3,140 views
0 votes
2 answers

What is the use of @Override annotation in Java ? When do we use it ?

@Override annotation is used when we override ...READ MORE

Aug 14, 2019 in Java by Sirajul
• 59,230 points
3,124 views
0 votes
1 answer

Difference between checked and unchecked exception

Checked Exceptions : The exceptions which are checked by ...READ MORE

Jul 16, 2018 in Java by Akrati
• 3,190 points
3,091 views
0 votes
1 answer

Can Enum implement Class

Enum is a type similar to that ...READ MORE

May 27, 2019 in Java by Sirajul
• 59,230 points
3,087 views
0 votes
2 answers

How to convert byte array to String and STring to byte array?

The best possible way of conversion between byte[] and String is to ...READ MORE

Aug 22, 2019 in Java by Sirajul
• 59,230 points
3,063 views
0 votes
2 answers

How to convert a JSON String into Object in Java?

You could probably check out Google's Gson: ...READ MORE

Aug 21, 2019 in Java by Sirajul
• 59,230 points
3,047 views
+1 vote
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
3,036 views