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
546 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,165 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,885 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,468 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
402 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,025 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,959 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,283 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
653 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,245 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
479 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
468 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
750 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,539 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
991 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,726 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,625 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,121 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
715 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
481 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,179 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,214 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,996 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,230 points
618 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,944 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,106 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
597 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,487 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
368 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,079 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,963 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,713 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,220 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,077 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,541 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,508 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,083 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,187 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,199 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,492 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,768 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,111 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,909 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,221 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,230 points
2,913 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
923 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,975 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
793 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
623 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,674 views