Most viewed questions in Java

0 votes
1 answer

FirebaseListAdapter not pushing individual items for chat app

o let the FirebaseRecyclerAdapter and FirebaseListAdapter show ...READ MORE

Feb 14, 2019 in Java by developer_1
• 3,320 points
1,880 views
0 votes
2 answers

Get all the permutations of a string in Java

You could use recursion to do this.  Try ...READ MORE

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

Cannot read property 'push' of undefined when combining arrays

The reason why you get this ERROR ...READ MORE

Feb 11, 2022 in Java by Rahul
• 9,670 points
1,848 views
0 votes
2 answers

What is a StackOverflow Error

stackoverflow error – StackOverflow Error in Java. This error is thrown to ...READ MORE

Aug 29, 2020 in Java by Pistle
• 1,000 points
1,846 views
0 votes
0 answers

Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1

I am getting this error when I ...READ MORE

May 20, 2022 in Java by Kichu
• 19,050 points
1,836 views
0 votes
1 answer

How do I count the number of occurrences of a char in a String?

My 'idiomatic one-liner' for this is: int count ...READ MORE

Dec 30, 2020 in Java by Gitika
• 65,910 points
1,819 views
0 votes
1 answer

Reason for java.lang.IncompatibleClassChangeError

Well these kinda error generally occur when ...READ MORE

Nov 14, 2018 in Java by code.reaper12
• 3,500 points
1,811 views
0 votes
1 answer

How do I save a String to a text file using Java?

If you're simply outputting text, rather than ...READ MORE

Dec 30, 2020 in Java by Gitika
• 65,910 points

edited Jul 6, 2023 by Khan Sarfaraz 1,810 views
0 votes
1 answer

Failed to load resource: the server responded with a status of 404 (not found)

In order to avoid an error while ...READ MORE

Feb 8, 2022 in Java by Rahul
• 9,670 points
1,805 views
0 votes
1 answer

JSON parsing in Java using Gson

Well, you can easily do that by ...READ MORE

Nov 22, 2018 in Java by code.reaper12
• 3,500 points
1,799 views
0 votes
0 answers

How to declare an array of different data types

In Java, I am working with arrays, ...READ MORE

Aug 3, 2022 in Java by krishna
• 2,820 points
1,798 views
0 votes
1 answer

Exception in thread main java.util.InputMismatchException error

Problem int name; //Name should be of type ...READ MORE

Feb 18, 2022 in Java by Rahul
• 9,670 points
1,795 views
+1 vote
1 answer

How to get Alias name of AWS Lambda function from java code?

Hey @Abhishek, you could probably use the ...READ MORE

Apr 1, 2020 in Java by Sirajul
• 59,230 points
1,792 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,792 views
0 votes
1 answer

GSON fails to read/map a field with name like USERId

Hello @ RamaKrishnaRaju, You should note the Javadoc of configureMessageConverters states ...READ MORE

Jul 2, 2020 in Java by Niroj
• 82,880 points
1,791 views
0 votes
1 answer

notify() vs. notifyAll() in Java

notify() is used to wake any thread in the wait ...READ MORE

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

Error:javax.net.ssl.SSLHandshakeException Error?

Hello @kartik, First, you need to obtain the ...READ MORE

May 21, 2020 in Java by Niroj
• 82,880 points
1,779 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 29, 2019 in Java by anonymous
• 160 points

closed Jan 14, 2020 by Kalgi 1,779 views
0 votes
0 answers

what is cannot find symbol this(SimpleTimeLimiter.create(THREAD_POOL));

Hi, Through command line, I'm trying to compile ...READ MORE

Nov 6, 2020 in Java by zaraaq
• 270 points

edited Nov 6, 2020 by Gitika 1,773 views
0 votes
2 answers

Does the finally block always execute in Java?

public static void main(String[] args) { ...READ MORE

Aug 8, 2018 in Java by Sushmita
• 6,910 points
1,769 views
0 votes
1 answer

How to get an enum value from a string value in Java?

Hello @kartik, Yes, Blah.valueOf("A") will give you Blah.A. Note that the name ...READ MORE

Jul 28, 2020 in Java by Niroj
• 82,880 points
1,768 views
0 votes
2 answers

How to convert a byte into Hexadecimal in Java?

private static final String ...READ MORE

Aug 29, 2019 in Java by Sirajul
• 59,230 points
1,762 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
• 18,570 points
1,743 views
0 votes
1 answer

Writing a UTF-8 file with Java

You can make use of a FileOutputStream rather than ...READ MORE

Oct 15, 2018 in Java by anto.trigg4
• 3,440 points
1,740 views
0 votes
1 answer

i am getting sessionnotcreatedexception in appium

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

Jun 27, 2019 in Java by ajs3033
• 7,300 points
1,736 views
0 votes
1 answer

What does NaN mean in Java?

"NaN" stands for "not a number". "Nan" ...READ MORE

Jul 12, 2018 in Java by Akrati
• 960 points
1,727 views
0 votes
1 answer

jQuery fix for "Uncaught TypeError: $ is not a function" error

 Use the following lines of code in ...READ MORE

Feb 16, 2022 in Java by Aditya
• 7,680 points
1,710 views
0 votes
1 answer

What is the use of serialVersionUID ?

The docs for java.io.Serializable are probably about as good ...READ MORE

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

Types of transaction management in Spring Framework

Well there are basically to types of ...READ MORE

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

Determining Class of an Object in Java

You can use: Object instance = new SomeClass(); instance.getClass().getName(); ...READ MORE

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

What is the difference between jdk and jre?

JRE: It stands for Java Runtime Environment. ...READ MORE

Apr 20, 2018 in Java by Akrati
• 3,190 points
1,701 views
0 votes
0 answers

Eclipse "Error: Could not find or load main class"

I have a project on my laptop ...READ MORE

May 7, 2022 in Java by narikkadan
• 63,620 points
1,696 views
0 votes
1 answer

How to convert a string representation of a hex dump to a byte array using Java?

public static byte[] hexStringToByteArray(String s) { ...READ MORE

Sep 26, 2018 in Java by sharth
• 3,370 points
1,695 views
0 votes
1 answer

What's the difference between SoftReference and WeakReference in Java?

Weak references A weak reference, simply put, is a ...READ MORE

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

How to pretty print XML from Java?

Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //initialize StreamResult ...READ MORE

Jul 4, 2018 in Java by Akrati
• 3,190 points
1,693 views
+4 votes
3 answers

What are the steps to set Java_home on Windows?

Set Java Home JAVA_HOME = C:\Program Files\Java\jdk1.7.0 [Location ...READ MORE

Sep 18, 2018 in Java by Sushmita
• 6,910 points
1,691 views
0 votes
1 answer

What is the difference between getPath(), getAbsolutePath() and getCanonicalPath() in Java?

getPath() - returns a String which denotes the ...READ MORE

Jul 26, 2018 in Java by Mrunal
• 680 points
1,690 views
0 votes
1 answer

When to use LinkedList over ArrayList in Java?

LinkedList and ArrayList are two different implementations of the List ...READ MORE

Dec 21, 2020 in Java by Gitika
• 65,910 points
1,677 views
0 votes
1 answer

Simple HTTP server in Java using only Java SE API

You can write a pretty simple embedded Jetty Java ...READ MORE

Aug 29, 2018 in Java by Parth
• 4,630 points
1,667 views
0 votes
1 answer

Java version mismatch

We get this error when we write ...READ MORE

Feb 21, 2019 in Java by Vaishnavi
1,663 views
0 votes
1 answer

Can Static methods be inherited in java?

A subclass inherits all of the public ...READ MORE

Apr 30, 2018 in Java by Daisy
• 8,120 points
1,662 views
0 votes
2 answers

How can I get the filenames of all files in a folder which may or may not contain duplicates

List<String> results = new ArrayList<String>(); File[] files = ...READ MORE

Sep 12, 2018 in Java by Sushmita
• 6,910 points
1,659 views
0 votes
0 answers

java.lang.NumberFormatException: null i

I am getting this error while doing ...READ MORE

May 13, 2022 in Java by Kichu
• 19,050 points
1,656 views
0 votes
1 answer

Using setTimeout to delay timing of jQuery actions

To answer your question, the .html() only ...READ MORE

Feb 9, 2022 in Java by Rahul
• 9,670 points
1,648 views
0 votes
1 answer

Understanding Spring @Autowired usage

TL;DR The @Autowired annotation spares you the need ...READ MORE

Nov 30, 2018 in Java by Sushmita
• 6,910 points
1,638 views
0 votes
2 answers

What is the use of final class in java?

In Java, items with the final modifier cannot be ...READ MORE

Oct 5, 2018 in Java by Daisy
• 8,120 points
1,638 views
0 votes
1 answer

Find common element between two array.

You just need nested loop, that will ...READ MORE

Mar 11, 2019 in Java by Esha Gupta
1,634 views
0 votes
1 answer

Write files to external public storage in Android

MediaStore has not discovered your newly-created files yet. ...READ MORE

Mar 1, 2019 in Java by developer_1
• 3,320 points
1,630 views
0 votes
1 answer

How to connect Java program to the MySQL database?

You can connect your Java code with ...READ MORE

May 11, 2018 in Java by Parth
• 4,630 points
1,628 views
0 votes
1 answer

Error:The method must override a superclass method after importing a project into Eclipse

Hello @kartik, This problem happened when I imported ...READ MORE

Jul 28, 2020 in Java by Niroj
• 82,880 points
1,626 views