Most voted questions in Java

0 votes
2 answers

Is there a SortedList in Java?

Since all lists are already "sorted" by ...READ MORE

Nov 2, 2018 in Java by Sushmita
• 6,910 points
4,211 views
0 votes
1 answer

Can we convert a string to hexadecimal in java

I find this to be an easy ...READ MORE

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

How to retrieve column names from java.sql.ResultSet?

You may refer the below code: ResultSet ...READ MORE

Jul 4, 2018 in Java by sophia
• 1,400 points
2,501 views
0 votes
1 answer

Interface variable are static and final by default. Why?

Interface variables are static because Java interfaces ...READ MORE

Jul 4, 2018 in Java by Daisy
• 8,120 points
12,805 views
0 votes
1 answer

Bean Scopes in Java Spring

According to my knowledge, the Spring Framework ...READ MORE

Jul 4, 2018 in Java by geek.erkami
• 2,680 points
1,026 views
0 votes
1 answer

Annotation wiring in Spring

By default, Annotation wiring is not turned ...READ MORE

Jul 4, 2018 in Java by code.reaper12
• 3,500 points
1,001 views
0 votes
1 answer

Measure time elapsed in Java?

This is also a way to work ...READ MORE

Jul 4, 2018 in Java by scarlett
• 1,290 points
616 views
0 votes
1 answer

Number of lines in a file in Java

I found this an efficient way in counting ...READ MORE

Jul 4, 2018 in Java by scarlett
• 1,290 points
434 views
0 votes
1 answer

Iterating through a Collection, avoiding ConcurrentModificationException when removing in loop

You can either use the iterator directly ...READ MORE

Jul 3, 2018 in Java by Rishabh
• 3,620 points
1,164 views
0 votes
1 answer

Continue Keyword in Java

continue is kind of like goto. Are you familiar ...READ MORE

Jul 3, 2018 in Java by Rishabh
• 3,620 points
383 views
0 votes
1 answer

How to get a platform-dependent new line character in Java?

If you are using Java 1.5 or ...READ MORE

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

Difference between JSF, Servlet and JSP?

Servlet - it's java server side layer. JSP ...READ MORE

Jul 3, 2018 in Java by samarth295
• 2,220 points
1,333 views
0 votes
2 answers

How do I get the size of a java.sql.ResultSet?

You could probably do rows-count. ResultSet rs = ...READ MORE

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

How to sort array in descending order

there are some traditional ways that you ...READ MORE

Jul 4, 2018 in Java by Priyaj
• 58,090 points
961 views
0 votes
1 answer

How can we format float to n decimal places ?

You may pass the float value: String.format("%.2f", floatVal); READ MORE

Jul 2, 2018 in Java by sophia
• 1,400 points
1,163 views
0 votes
1 answer

A Java collection of value pairs? (tuples?)

The Pair class is one of those ...READ MORE

Jul 2, 2018 in Java by sharth
• 3,370 points
2,240 views
0 votes
1 answer

How to get the Generic type of class at run time?

public class GenericClass<T> { ...READ MORE

Jul 2, 2018 in Java by Akrati
• 3,190 points
658 views
0 votes
0 answers

How to populate a ListView using an ArrayList?

I want to populate the data coming ...READ MORE

Jun 30, 2018 in Java by misc.edu04
• 1,450 points
975 views
0 votes
1 answer

ThreadLocal variables usage in Java

public class Test { // ...READ MORE

Jun 30, 2018 in Java by code.reaper12
• 3,500 points
469 views
0 votes
1 answer

No appenders could be found for logger(log4j)?

Just to get you going you have ...READ MORE

Jun 29, 2018 in Java by Akrati
• 3,190 points
8,354 views
0 votes
2 answers

What is the difference between getAttribute() and getParameter() in java?

getParameter() returns http request parameters. Those passed from ...READ MORE

Aug 28, 2019 in Java by Sirajul
• 59,230 points
21,633 views
0 votes
2 answers

How can we convert java.util.Date to java.sql.date in Java?

It's easy to convert a java.util.Date object ...READ MORE

Aug 27, 2019 in Java by Sirajul
• 59,230 points
1,085 views
0 votes
1 answer

What are Daemon threads in Java?

A daemon thread is a thread that is doing ...READ MORE

Jun 29, 2018 in Java by Daisy
• 8,120 points
565 views
0 votes
1 answer

How to configure Android SDK for finding JDK

Actual SETUP: OS: Windows 8.1 JDK file: jdk-8u11-windows-x64.exe ADT file: ...READ MORE

Jun 29, 2018 in Java by Rishabh
• 3,620 points
542 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,776 views
0 votes
1 answer

How to add row in JTable

To create a table: JTable table = new ...READ MORE

Jun 29, 2018 in Java by Akrati
• 960 points
2,751 views
0 votes
1 answer

Calling SOAP web services on Android using JAVA

Android does not provide any sort of ...READ MORE

Jun 28, 2018 in Java by Sushmita
• 6,910 points
2,402 views
0 votes
1 answer

How can we run the .jar file by double clicking on windows 7 (64)?

Use the following method to run the ...READ MORE

Jun 28, 2018 in Java by sharth
• 3,370 points
1,608 views
0 votes
1 answer

How can we use java property files?

You can refer the below code: Properties properties ...READ MORE

Jun 28, 2018 in Java by Akrati
• 960 points
515 views
0 votes
1 answer

What is the use of assert keyword in java?

Java assertion feature allows the developer to ...READ MORE

Jun 28, 2018 in Java by scarlett
• 1,290 points
616 views
0 votes
1 answer

Multiple return statements in Java

Yes, you have guessed it right. Language ...READ MORE

Jun 28, 2018 in Java by geek.erkami
• 2,680 points
1,982 views
0 votes
2 answers

How does random shuffling of an array

Here is a simple way using an ArrayList: List<Integer> ...READ MORE

Nov 2, 2018 in Java by Sushmita
• 6,910 points
698 views
0 votes
1 answer

How to convert or cast hashmap to JSON object in Java, and again convert JSON object to JSON string?

You can use: new JSONObject(map); READ MORE

Jun 27, 2018 in Java by Akrati
• 3,190 points
6,626 views
0 votes
1 answer

Examples of GoF Design Patterns in Java's core libraries

Observer pattern throughout whole swing (Observable, Observer) MVC also ...READ MORE

Jun 27, 2018 in Java by developer_1
• 3,320 points
1,641 views
0 votes
1 answer

How can we add local .jar file dependency to build.gradle file?

You can refer the below code if ...READ MORE

Jun 27, 2018 in Java by Akrati
• 960 points
5,090 views
0 votes
2 answers

How can we pass a function as a parameter in java?

Java 8 and above Using Java 8+ lambda ...READ MORE

Aug 28, 2018 in Java by Daisy
• 8,120 points
1,282 views
0 votes
2 answers

How do I rename a file using Java

// File (or directory) with old name File ...READ MORE

Oct 5, 2018 in Java by Sushmita
• 6,910 points
622 views
0 votes
1 answer

Why there is the need of getters and setters in java

In Java getters and setters are completely ...READ MORE

Jun 26, 2018 in Java by scarlett
• 1,290 points
1,809 views
0 votes
1 answer

How to prevent java.lang.NumberFormatException in Java?

"N/A" is not integer. It must throw NumberFormatException if you ...READ MORE

Jun 26, 2018 in Java by sharth
• 3,370 points
4,505 views
0 votes
2 answers

Setting Proxy for JVM usage

JVM uses the proxy to make HTTP ...READ MORE

Aug 26, 2019 in Java by Sirajul
• 59,230 points
2,365 views
0 votes
1 answer

Working of Progress Bar for a File Download

Once of the ways to achieve is ...READ MORE

Jun 26, 2018 in Java by Rishabh
• 3,620 points
6,055 views
0 votes
1 answer

Can a static reference be made to a non-static method

setLoanItem() isn't a static method, it's an instance ...READ MORE

Jun 26, 2018 in Java by samarth295
• 2,220 points
669 views
0 votes
1 answer

How to get the IP address of the machine using Java?

One approach is to use NetworkInterface.getNetworkInterfaces() to get all ...READ MORE

Jun 25, 2018 in Java by sharth
• 3,370 points
789 views
0 votes
1 answer

Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

Check the maven repository server is up. Check ...READ MORE

Jun 25, 2018 in Java by Sushmita
• 6,910 points
5,566 views
0 votes
1 answer

Trusting all certificates using HttpClient over HTTPS

Note: Do not implement this in production ...READ MORE

Jun 25, 2018 in Java by Rishabh
• 3,620 points
11,080 views
0 votes
1 answer

How to pass an object from one activity to another on Android

One option could be letting your custom ...READ MORE

Jun 25, 2018 in Java by Rishabh
• 3,620 points
4,686 views
0 votes
1 answer

How to convert s Stack trace to a String?

One can use the given method to ...READ MORE

Jun 25, 2018 in Java by sharth
• 3,370 points
745 views
0 votes
13 answers

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

Adding custom JAR files to the EAR project Copy the custom JAR to the ...READ MORE

Dec 10, 2020 in Java by Nikita
185,983 views
0 votes
3 answers

What is ^ operator in java?

It's bitwise XOR, Java does not have ...READ MORE

Oct 31, 2018 in Java by Sushmita
• 6,910 points
797 views
0 votes
2 answers

How can I do url string decoding in java

We can use URLDecoder: URLDecoder.decode( url, "UTF-8" ); READ MORE

Dec 7, 2018 in Java by Sushmita
• 6,910 points
617 views