Blog Archives

Part 6: Intermediate What is wrong with this Java code?

Q. What is wrong with the following Java code? Explain what does the following code do? Explain if there is anything wrong with the following code? If there is something wrong, how will you go about fixing it?

A. 1. Explanation a. The main thread gets implicitly created by…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, What is wrong with this code?

Part 4: Beginner what is wrong with this Java code?

Q10 What is wring with this code?

A10. date1 == date2 only compares the references and not the actual dates. Since both the references are different objects, they will never be the same, and nothing will be printed. This is also known as the “shallow” comparison. To fix it:…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, What is wrong with this code?

Part 3: Beginner what is wrong with this Java code?

Q9 What is wring with this code?

A9. throws a Runtime exception called “java.util.ConcurrentModificationException” The output will be:

Fix 1: Use it.remove();

Output:

Fix 2: Use CopyOnWriteArrayList;

Output:

...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, What is wrong with this code?

Part 2: Beginner what is wrong with this Java code?

Q6. What is wring with this code?

A6. Infinite loop at due to sum != 1.0. Using floating point variables like float or double in loops to compare for equality can lead to infinite loops. Comparing for “>” or “...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, What is wrong with this code?

Part 1: ♥ Beginner what is wrong with this Java code?

Q1. What is wrong with this code?

A1. compile-error at switch(i) as switch works only with “int” and “String” (i.e. from Java 7 onwards) data types. Q2. What is wrong with this code?

A2. “java.lang.NullPointerException” at “entry.value > 0”. Use short circuit “&&” instead to not check “entry.value

Read more ›

Posted in What is wrong with this code?

Works only with string types issue

Q. Can you review the following code and see if it has any issues?

A. The “MyStack” class is not properly using “generics”. It only works with “String” class. Here is the revised solution using generics to work with any object type.

The above example shows that “MyStack”…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, What is wrong with this code?

Part 5: Intermediate What is Wrong with this Java code?

An excellent written test question to assess your Java multi-threading knowledge. Please practice it by doing it yourself. Q. Review the code shown below and then answer the following questions.

Q1. What does the above code do? Q2. What are the issues with the above code? Q3. How will…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, What is wrong with this code?
1100+ paid subscribers. Reviews | Free Contents. Monthly 260K+ views & 40k+ visitors. 9 tips to earn more.

Java Developer Training – 800+ Q&As ♥Free|♦FAQ (Mouse Hover for Tooltip)

open all | close all

200+ Java Developer Job Interview FAQs

open all | close all

16 Java Programmer Key Areas to be a top-notch

open all | close all

80+ Java Tutorials – Step by step

open all | close all

100+ Java Developer Coding Exercises

open all | close all

How good are your …..Java job hunting & career fast-tracking skills?

open all | close all