Trending 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 17 in Java by Frankie
• 9,810 points
56 views
0 votes
1 answer

FirebaseListAdapter not pushing individual items for chat app

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

Feb 13 in Java by developer_1
• 3,300 points
204 views
0 votes
1 answer

Switch JPanels inside a JFrame

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

Feb 13 in Java by developer_1
• 3,300 points
118 views
0 votes
2 answers

What is the difference between getAttribute() and getParameter() in java?

getParameter() returns http request parameters. Those passed from ...READ MORE

Aug 28 in Java by Sirajul
• 31,740 points
803 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 in Java by developer_1
• 3,300 points
26 views
0 votes
0 answers

how to solve thread-cannot find symbol

Feb 11 in Java by anonymous
66 views
0 votes
1 answer

Concept of Shadowing in Java

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

Feb 8 in Java by developer_1
• 3,300 points
120 views
0 votes
1 answer

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

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

Jan 8 in Java by Daisy
• 8,050 points
1,405 views
0 votes
0 answers

What is the difference between Default and Protected access specifiers?

Can anyone explain in brief as what ...READ MORE

Feb 6 in Java by Dishantu
180 views
0 votes
2 answers

Why are you not able to declare a class as static in Java?

A static keyword  can be used with ...READ MORE

Jun 11 in Java by Neha
• 330 points
95 views
0 votes
1 answer

Multiple return types in Java

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

Feb 8 in Java by developer_1
• 3,300 points
28 views
0 votes
2 answers

How to return multiple objects from a Java method?

In the event the method you're calling ...READ MORE

Aug 30 in Java by Karan
• 4,050 points
122 views
0 votes
1 answer

Why Object is Super Class in Java?

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

Feb 7 in Java by Dheeraj
36 views
0 votes
1 answer

Architecture mismatch between driver and application

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

Feb 6 in Java by developer_1
• 3,300 points
50 views
0 votes
1 answer

Access method without creating Object

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

Feb 7 in Java by Dheeraj
32 views
0 votes
1 answer

What are the advantages of Dynamic Polymorphism?

Advantages of Dynamic Polymorphism Dynamic Polymorphism allows Java ...READ MORE

Jan 31 in Java by Frankie
• 9,810 points
274 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 in Java by Priyaj
• 56,900 points
47 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 in Java by developer_1
• 3,300 points
46 views
0 votes
1 answer

String mapping without Case-Sensitivity

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

Feb 5 in Java by developer_1
• 3,300 points
36 views
0 votes
2 answers

Is there any way to declare an array in-line?

Another way to do that, if you ...READ MORE

Aug 30 in Java by Sirajul
• 31,740 points
26 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 in Java by Sirajul
• 31,740 points
84 views
0 votes
1 answer

USing Java App to create Windows Service

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

Feb 1 in Java by developer_1
• 3,300 points
46 views
0 votes
1 answer

Use annotation for excluding specific fields from serialization

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

Feb 1 in Java by developer_1
• 3,300 points
37 views
0 votes
2 answers

Unfortunately MyApp has stopped. How do I solve this?

The common solution for solving App has ...READ MORE

Mar 6 in Java by AllisonE
• 180 points
64 views
0 votes
2 answers

What is the easiest way to iterate through the characters of a string in Java?

There are two approaches to this: for(int i ...READ MORE

Aug 19 in Java by Sirajul
• 31,740 points
78 views
0 votes
2 answers

Setting Proxy for JVM usage

JVM uses the proxy to make HTTP ...READ MORE

Aug 26 in Java by Sirajul
• 31,740 points
254 views
0 votes
1 answer

Implementing mouseover() function in Selenium webdriver

This code works perfectly well: Actions builder ...READ MORE

Jan 22 in Java by developer_1
• 3,300 points
349 views
0 votes
2 answers

How can we convert java.util.Date to java.sql.date in Java?

It's easy to convert a java.util.Date object ...READ MORE

Aug 27 in Java by Sirajul
• 31,740 points
80 views
0 votes
2 answers

How can I address the unchecked cast warnings?

@SuppressWarnings("unchecked") READ MORE

Mar 21 in Java by anonymous
1,514 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 in Java by developer_1
• 3,300 points
96 views
0 votes
0 answers

How execute JSP web page in Intellij

Hi all, I am new to java and ...READ MORE

Jan 24 in Java by Abraham
• 120 points
76 views
0 votes
1 answer

What is Eclipse Clean Mode ?

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

Jan 11 in Java by developer_1
• 3,300 points
531 views
0 votes
2 answers

Give an example for encryption and decryption in AES using Java

getfullstring: Splashscreen.text >>> READ MORE

May 8 in Java by anonymous
2,050 views
0 votes
2 answers

How to convert a java string into byte array

Try using String.getBytes(). It returns a byte[] ...READ MORE

Aug 22 in Java by Sirajul
• 31,740 points
65 views
0 votes
2 answers

How can I convert byte array into hex string in Java?

public static String byteArrayToHex(byte[] a) { ...READ MORE

Aug 29 in Java by Sirajul
• 31,740 points
501 views
0 votes
2 answers

How to convert a JSON String into Object in Java?

You could probably check out Google's Gson: ...READ MORE

Aug 21 in Java by Sirajul
• 31,740 points
347 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,050 points
1,777 views
0 votes
2 answers

Listing all the subclasses of a specific class in Java

This is not possible to do using ...READ MORE

Aug 21 in Java by Sirajul
• 31,740 points
258 views
0 votes
1 answer

Creating a JUnit Test Suite Class

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

Jan 17 in Java by Frankie
• 9,810 points
54 views
0 votes
1 answer

How can you catch an exception thrown by another thread in Java?

This can be done using Thread.UncaughtExceptionHandler. Here’s a simple ...READ MORE

Dec 3, 2018 in Java by Frankie
• 9,810 points
1,963 views
0 votes
1 answer

Lazy Initialization Error in Java

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

Jan 14 in Java by developer_1
• 3,300 points
145 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 in Java by Sirajul
• 31,740 points
324 views
0 votes
2 answers

How to convert an int array to string using tostring method in java?

Use java.util.Arrays: String res = Arrays.toString(array); System.o ...READ MORE

Aug 16 in Java by Sirajul
• 31,740 points
241 views
0 votes
2 answers

Reserving space for a heap object

Run the JVM with -XX:MaxHeapSize=512m (or any big number ...READ MORE

Aug 26 in Java by Sirajul
• 31,740 points
146 views
0 votes
2 answers

How can we display an output of float data with 2 decimal places in java? Please help

Use String.format()  if you need the value as ...READ MORE

Aug 26 in Java by Sirajul
• 31,740 points
54 views
0 votes
1 answer

object references an unsaved transient instance - save the transient instance before flushing

You should add cascade="all" (if using xml) ...READ MORE

Sep 26, 2018 in Java by parth295
• 4,640 points
4,832 views
0 votes
1 answer

Ways to compare String Values

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

Jan 14 in Java by developer_1
• 3,300 points
49 views
0 votes
1 answer

Xml to Json Conversion

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

Jan 10 in Java by developer_1
• 3,300 points
198 views
0 votes
3 answers

How autowiring works in Spring?

First, and most important - all Spring ...READ MORE

Jan 11 in Java by developer_1
• 3,300 points
74 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 in Java by developer_1
• 3,300 points
227 views