Trending questions in Java

+2 votes
10 answers

Convert Java Byte Array - String - Byte Array

Character Stream Vs Byte Stream Character oriented are ...READ MORE

Sep 25, 2018 in Java by carldivin
• 180 points
10,729 views
0 votes
2 answers

How to iterate in a HashMap in Java?

Iterating using Iterator. Using Generics: Map<Integer, Integer> map = ...READ MORE

Aug 28, 2019 in Java by Sirajul
• 59,230 points
1,040 views
0 votes
3 answers

How can I add new elements to an Array in Java

String[] source = new String[] { "a", ...READ MORE

Sep 19, 2018 in Java by Sushmita
• 6,920 points
13,343 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,350 points
3,814 views
0 votes
2 answers

How can we add leading zeros to the number in Java?

From Java 1.5 you can use the String.format method. ...READ MORE

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

What is integer boxing in java?

In Java the boxing range for any ...READ MORE

Mar 6, 2019 in Java by Avantika
• 1,520 points
2,799 views
0 votes
1 answer

DTO vs VO vs POJO vs JavaBeans

Data Transfer Object is used for transferring a collection ...READ MORE

Aug 14, 2018 in Java by code.reaper12
• 3,500 points

edited Oct 7, 2021 by Sarfaraz 11,611 views
0 votes
1 answer

Autowired field pointing NULL in Spring

The field annotated @Autowired is null because ...READ MORE

Jun 6, 2018 in Java by Avi
• 160 points

edited Mar 4, 2022 by Sarfaraz 14,490 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
4,075 views
0 votes
1 answer

Java Client Certificate over HTTPS/SSL

The missing links was (mostly) the first ...READ MORE

Nov 28, 2018 in Java by Sushmita
• 6,920 points
6,835 views
0 votes
1 answer

How to get rid of TLE in Java?

The TLE (Time limit exceed) problem occurs ...READ MORE

Mar 5, 2019 in Java by Disha
2,616 views
0 votes
1 answer

Received fatal alert: handshake_failure through SSLHandshakeException

On update 51, java 1.8 prohibited[1] RC4 ...READ MORE

Dec 5, 2018 in Java by Daisy
• 8,140 points
6,455 views
0 votes
1 answer

How to call a method from Constructor?

Have a glance at below steps: You create ...READ MORE

Nov 13, 2018 in Java by Frankie
• 9,830 points
7,154 views
0 votes
2 answers

How can we add an image to a JPanel?

If you are using JPanels, then are ...READ MORE

Sep 20, 2018 in Java by Daisy
• 8,140 points
11,768 views
0 votes
1 answer

“Missing return statement” within if / for / while in Java

Putting a return statement in any of the ...READ MORE

Sep 27, 2018 in Java by code.reaper12
• 3,500 points
9,110 views
0 votes
1 answer

HashMap with multiple values under the same key

Use a map that has a list ...READ MORE

Dec 13, 2018 in Java by Sushmita
• 6,920 points
5,750 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,350 points
3,927 views
0 votes
1 answer

Calling remove in foreach loop in Java

To safely remove from a collection while ...READ MORE

Sep 26, 2018 in Java by sharth
• 3,370 points
9,034 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,831 views
0 votes
1 answer

Method for escaping HTML in Java

242 StringEscapeUtils from Apache Commons Lang: import static org.apache.commons.lang.StringEscapeUtils.escapeHtml; // ... String source ...READ MORE

Jan 9, 2019 in Java by developer_1
• 3,350 points
4,453 views
0 votes
2 answers

Result of character addition in Java

Binary arithmetic operations on char and byte ...READ MORE

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

How to move or copy a file in Java

The new JAVA Specification Request 203 -NIO will ...READ MORE

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

How to resolve 'Must Override a Superclass Method' Errors after importing a project into Eclipse ?

Eclipse is defaulting to Java 1.5 and ...READ MORE

Jan 10, 2019 in Java by developer_1
• 3,350 points
4,340 views
0 votes
1 answer

Eclipse java debugging: source not found

Eclipse debugging works with the class actually loaded by ...READ MORE

Oct 25, 2018 in Java by Daisy
• 8,140 points
7,672 views
0 votes
1 answer

What is an Operand Stack in Java?

The basic utility of Operand Stack are ...READ MORE

Mar 7, 2019 in Java by Priyaj
• 58,020 points
1,936 views
0 votes
2 answers

Reading an InputStream & coverting it into a String in Java?

Apache Commons allows: String myString = IOUtils.toString(myInputStream, "UTF-8"); And ...READ MORE

Aug 30, 2019 in Java by Karan
• 19,610 points
1,219 views
0 votes
1 answer

Create fucntion to find GCD of two numbers

Hey @Diya, here is a code on how ...READ MORE

Mar 28, 2019 in Java by Priyaj
• 58,020 points
902 views
0 votes
0 answers

Iterate over json and output multiple rows

I have a json in which multiple ...READ MORE

Mar 12, 2019 in Java by Yogesh
1,587 views
0 votes
2 answers

What are all the different ways to create an object in Java?

There are different ways you could do this ...READ MORE

Aug 19, 2019 in Java by Sirajul
• 59,230 points
1,204 views
0 votes
2 answers

Java: convert List<String> to a String

With a java 8 collector, this can ...READ MORE

Aug 30, 2019 in Java by Sirajul
• 59,230 points
809 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,140 points
4,185 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
2,152 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,920 points
3,972 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,350 points
1,827 views
0 votes
1 answer

Count occurance of string in an array

You can use hashmap to solve this, ...READ MORE

Mar 7, 2019 in Java by Priyaj
• 58,020 points
1,550 views
0 votes
1 answer

Java version mismatch

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

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

How do I break out of nested loops in Java?

You can use break with a label for the ...READ MORE

Mar 13, 2019 in Java by trisha
1,244 views
0 votes
1 answer

Install Java on Ubuntu

Hi @Anvi, to install Java on Ubuntu, ...READ MORE

Mar 1, 2019 in Java by Pratibha
• 3,690 points
1,690 views
0 votes
1 answer

Difference between Instance Variable and Class Variable

A variable defined within a block or ...READ MORE

Mar 12, 2019 in Java by Reema
1,157 views
0 votes
1 answer

How can we run eclipse in clean mode? and what will happen if we do so?

if set to "true", any cached data ...READ MORE

Jan 11, 2019 in Java by Daisy
• 8,140 points
3,703 views
0 votes
1 answer

Extend an array after initialization

Here is the method I came up ...READ MORE

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

Merge two array in Java

This is very simple, you need an ...READ MORE

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

How to build jars from IntelliJ properly?

How to build a jar with IntelliJ ...READ MORE

Oct 12, 2018 in Java by sharth
• 3,370 points
7,601 views
0 votes
2 answers

String comparission in Java

You should use s1.equals(s2) instead of '==' ...READ MORE

Mar 14, 2019 in Java by anonymous
997 views
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,350 points
2,215 views
0 votes
1 answer

First panel added to a frame disappears

The default layout of a JFrame (or more specifically ...READ MORE

Mar 1, 2019 in Java by developer_1
• 3,350 points
1,522 views
0 votes
1 answer

Concept of Shadowing in Java

Entities (packages, types, methods, variables, etc.) defined ...READ MORE

Feb 8, 2019 in Java by developer_1
• 3,350 points
2,405 views
0 votes
2 answers

What is the difference between Type List and type ArrayList in Java

By List, you actually tell, that your object ...READ MORE

Aug 28, 2019 in Java by Sirajul
• 59,230 points
2,610 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,824 views