Blog Archives

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, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

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, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

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, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

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 wring 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 wring with this code?

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

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, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

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?

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, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

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?

Multithreaded Java code with issues & how will you fix it?

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, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

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?
1050+ subscribers. Reviews | Free Contents. 220K+ page views/month. Certified or not, you will be challenged with industrial strength problems to solve at work & job interviews.

600+ Interview Q&As – ♥ Free, ♦ FAQs

open all | close all

200+ FAQs for Quick Interview Prep

open all | close all

16 Technical Key Areas to standout

open all | close all

80+ Tutorials for self-taught projects

open all | close all

100+ pre-interview coding tests

open all | close all

How good are your …..?

open all | close all