Most answered questions in Java

0 votes
1 answer

What do you mean by aggregation in Java?

Aggregation is a specialized form of Association ...READ MORE

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

Switch JPanels inside a JFrame

Instead of trying to add an remove ...READ MORE

Feb 14, 2019 in Java by developer_1
• 3,320 points
12,116 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,320 points
1,875 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,449 views
0 votes
1 answer

Aligning Diagram in Java

Without any evidence otherwise, I'd guess you've over-ridden the paint method ...READ MORE

Feb 11, 2019 in Java by developer_1
• 3,320 points
395 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,320 points
2,011 views
0 votes
1 answer

Multiple return types in Java

No, you don't have two return types.It's ...READ MORE

Feb 8, 2019 in Java by developer_1
• 3,320 points
6,931 views
0 votes
1 answer

Architecture mismatch between driver and application

None of these did it for me. ...READ MORE

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

Why Object is Super Class in Java?

Object is an exception to the first rule, ...READ MORE

Feb 7, 2019 in Java by Dheeraj
642 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,227 views
0 votes
1 answer

String related Hash Functions

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

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

String mapping without Case-Sensitivity

Yes, contains is case sensitive. You can ...READ MORE

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

How is inheritance in C++ different than that in Java?

The purpose of inheritance is same for ...READ MORE

Feb 6, 2019 in Java by Priyaj
• 58,090 points
738 views
0 votes
1 answer

Use annotation for excluding specific fields from serialization

Simply mark the desired fields with the ...READ MORE

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

USing Java App to create Windows Service

Apache Commons Daemon is a good alternative. It ...READ MORE

Feb 1, 2019 in Java by developer_1
• 3,320 points
982 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,709 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,617 views
0 votes
1 answer

Accessing Json array with Java

An org.json.JSONArray is not iterable. Here's how I process elements ...READ MORE

Jan 22, 2019 in Java by developer_1
• 3,320 points
10,090 views
0 votes
1 answer

Creating a JUnit Test Suite Class

To create a test suite we will use the ...READ MORE

Jan 17, 2019 in Java by Frankie
• 9,830 points
691 views
0 votes
1 answer

Ways to compare String Values

== compares object references, it checks to see ...READ MORE

Jan 14, 2019 in Java by developer_1
• 3,320 points
466 views
0 votes
1 answer

Lazy Initialization Error in Java

What is wrong here is that your ...READ MORE

Jan 14, 2019 in Java by developer_1
• 3,320 points
2,166 views
0 votes
1 answer

What is Eclipse Clean Mode ?

What it does: if set to "true", any ...READ MORE

Jan 11, 2019 in Java by developer_1
• 3,320 points
11,179 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,120 points
2,960 views
0 votes
1 answer

Unable to Run the .java file

You have to enter the commands as ...READ MORE

Jan 11, 2019 in Java by Omkar
• 69,210 points
613 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,320 points
3,931 views
0 votes
1 answer

Xml to Json Conversion

To convert XML File in to JSON ...READ MORE

Jan 10, 2019 in Java by developer_1
• 3,320 points
2,091 views
0 votes
1 answer

Exception Handling: “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it

Iterator<String> iter = myArrayList.iterator(); while (iter.hasNext()) { ...READ MORE

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

Comparing Functions in Java

I would suggest that Version 1 is ...READ MORE

Jan 9, 2019 in Java by developer_1
• 3,320 points
362 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,320 points
4,062 views
0 votes
1 answer

How to convert a date string to a DateTime object using Joda Time library?

DateTimeFormatter formatter = DateTimeFormat.forPattern("dd/MM/yyyy HH:mm:ss"); DateTime dt = ...READ MORE

Jan 9, 2019 in Java by Daisy
• 8,120 points
1,935 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,681 views
0 votes
1 answer

Can I help with the gradle code for AspectJ?

You can go to maven repositories https://mvnrepository.com/artifact/org.aspectj/aspectjtools/1.9.2 ...READ MORE

Jan 9, 2019 in Java by Frankie
• 9,830 points
1,201 views
0 votes
1 answer

Where do we get the maven dependency code for Spring Beans?

Don't worry, you can just go through ...READ MORE

Jan 9, 2019 in Java by Frankie
• 9,830 points
2,049 views
0 votes
1 answer

How to solve this error: No Persistence provider for EntityManager named

After <persistence-unit name="agisdb">, define the persi ...READ MORE

Jan 8, 2019 in Java by Daisy
• 8,120 points
18,472 views
0 votes
1 answer

How can I solve this: To prevent a memory leak, the JDBC Driver has been forcibly unregistered

What can you do? Ignore these warnings. Tomcat ...READ MORE

Jan 8, 2019 in Java by Daisy
• 8,120 points
30,421 views
0 votes
1 answer

How can I run test methods in specific order in JUnit4?

@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class SampleTest { ...READ MORE

Jan 7, 2019 in Java by Daisy
• 8,120 points
1,075 views
0 votes
1 answer

simple HTTP server in Java using only Java SE API

The com.sun.net.httpserver solution is not portable across JREs. Its ...READ MORE

Jan 4, 2019 in Java by Daisy
• 8,120 points
2,178 views
0 votes
1 answer

“Unable to load native-hadoop library for your platform” warning: How to resolve it?

If you are running Hadoop on 64bit CentOS, ...READ MORE

Jan 4, 2019 in Java by Daisy
• 8,120 points
2,176 views
0 votes
1 answer

How to include jars in classpath using command line?

I have tried the following and it's ...READ MORE

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

How to set JDK in Eclipse?

To manage the list of compilers go ...READ MORE

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

How to specify the certificate to use for authenticating the server to client?

You can try the command given below. System.setProperty("javax.net ...READ MORE

Jan 2, 2019 in Java by Daisy
• 8,120 points
1,104 views
0 votes
1 answer

What is the need to override the equals and hashCode methods in Java?

You must override hashCode() in every class ...READ MORE

Jan 2, 2019 in Java by Daisy
• 8,120 points
2,889 views
0 votes
1 answer

Why is my Spring @Autowired field null?

If you are not coding a web ...READ MORE

Dec 27, 2018 in Java by Daisy
• 8,120 points

edited Mar 4, 2022 by Sarfaraz 18,187 views
0 votes
1 answer

Getting error 404 not found when trying to download JDK

Try this command, it should work: wget --no-check-certificate ...READ MORE

Dec 26, 2018 in Java by Omkar
• 69,210 points
2,899 views
0 votes
1 answer

Is there any difference between ConcurrentHashMap and Collections.synchronizedMap?

ConcurrentHashMap: It allows concurrent modification of the ...READ MORE

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

GSON throwing “Expected BEGIN_OBJECT but was BEGIN_ARRAY”?

This will work: ChannelSearchEnum[] enums = gson.fromJson(yourJson, ChannelSearchEnum[].class); But ...READ MORE

Dec 26, 2018 in Java by Sushmita
• 6,910 points
27,924 views
0 votes
1 answer

Why doesn't RecyclerView have onItemClickListener()?

I like this way and I'm using ...READ MORE

Dec 21, 2018 in Java by Daisy
• 8,120 points
786 views
0 votes
1 answer

Java and SQLite

The wikipedia lists some more wrappers: A good tutorial ...READ MORE

Dec 21, 2018 in Java by Daisy
• 8,120 points
613 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,642 views