Trending questions in Java

0 votes
0 answers

Where i have to put resource package so it's accessible by external jar in eclipse?

Servlet.init() for servlet [JERSEY] threw exception java.lang.ExceptionInInitializerError cause by ...READ MORE

May 29, 2019 in Java by anonymous

edited May 30, 2019 by Omkar 658 views
+1 vote
2 answers

How to use try & catch block in Java?

Hey @Jino, Using try catch block for your ...READ MORE

Dec 21, 2018 in Java by Nabarupa
2,212 views
0 votes
1 answer

Deep copying a 2d array in Java

I guess, for deep copying you will ...READ MORE

Nov 13, 2018 in Java by code.reaper12
• 3,500 points
8,975 views
0 votes
1 answer

Mocking static methods with Mockito

@RunWith(PowerMockRunner.class) @PrepareForTest(DriverManager.class) public class Mocker { ...READ MORE

Dec 12, 2018 in Java by Daisy
• 8,140 points
7,545 views
+1 vote
0 answers

How to install java on linux operating system?

I read good info about java but ...READ MORE

May 16, 2019 in Java by Vicky

reopened Nov 15, 2024 by Neelam 738 views
0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

Nov 5, 2018 in Java by Sushmita
• 6,920 points
12,303 views
0 votes
1 answer

Access method without creating Object

This is not possible in java. You ...READ MORE

Feb 7, 2019 in Java by Dheeraj
4,824 views
0 votes
2 answers

What is the meaning of purpose of this command: java -jar <some jar file>.jar ?

JAR (Java Archive) file is a package file ...READ MORE

Mar 22, 2019 in Java by Omkar
• 69,220 points
2,876 views
0 votes
1 answer

Start a Standalone Application in Java

You can make this work by calling start(...) directly on a ...READ MORE

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

Configuration metadata in Spring Framework

Configuration metadata can be provided to Spring container in ...READ MORE

Aug 3, 2018 in Java by code.reaper12
• 3,500 points
12,762 views
+1 vote
1 answer

What are the types of memory in JVM?

The different types of Memory in JVM ...READ MORE

Mar 7, 2019 in Java by Priyaj
• 58,020 points
3,280 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,806 views
0 votes
3 answers

How does the “final” keyword in Java work?

Final is a keyword that is used ...READ MORE

Sep 1, 2019 in Java by DEEPAK KUMAR GUPTA
2,694 views
0 votes
2 answers

Give an example for encryption and decryption in AES using Java

getfullstring: Splashscreen.text >>> READ MORE

May 8, 2019 in Java by anonymous
7,145 views
0 votes
2 answers

How to check if a string has only letters

You could probably use Java 8 lambda ...READ MORE

Aug 30, 2019 in Java by Karan
• 19,610 points
3,515 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,140 points
13,875 views
+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,893 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,821 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,123 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,936 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,297 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,881 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,564 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,199 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,754 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,940 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,529 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,295 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,950 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,219 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,173 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,803 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,586 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,997 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,173 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,508 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,893 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,891 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
2,062 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,749 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
1,050 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,331 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,685 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,293 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,293 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
894 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,225 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
4,118 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,901 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,391 views