Blog Archives

Tree structure – calculate average recursively & iteratively in Java

Q. Complete the following “TreeProcessingImpl” class ….. so that the unit tests shown below pass? Skeleton Code

Unit Tests

A. Solution 1:

Solution 2: Using recursion for getAverage(…) and iteration for getSum(…)

Key Points #1: Recursion can cause stack overflow exception if you…...

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

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

Click Here and check the contents with Try OR look for post titles with ♥

Log In | Register
Posted in member-paid, Passing the unit tests, Tree structure

Working with monetary values

Q. Complete the following “MonetaryProcessingImpl.java” class … so that the unit tests shown below pass? Skeleton code

The unit test that fails

A. Code that passes the test cases

Key Points Take note that test cases test for exceptions being thrown as well. So, input…...

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

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

Click Here and check the contents with Try OR look for post titles with ♥

Log In | Register
Posted in member-paid, Passing the unit tests

♥ Prerequisite: if want to work with Maven & eclipse

Here are the basic steps as to how I set up “passing” project using maven & eclipse for the coding exercises. If you are using other IDEs or command line approach then you can ignore this prerequisite. Just create the relevant packages and copy the classes in the passing the

Read more ›

Posted in Passing the unit tests

Working with a given input string & character processing

Q. Complete the following StringProcessingImpl.java” class ….. so that the unit tests shown below pass?

Unit test

Solution

Key points #1. The encode method is using the rot13 encoding that is used for hiding offensive material from accidental viewing, to not give away naughty jokes and discussions,…...

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

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

Click Here and check the contents with Try OR look for post titles with ♥

Log In | Register
Posted in member-paid, Passing the unit tests

Processing data from a file & sorting them

Q. Complete the following “DataProcessingImpl.java” class ….. so that the unit tests shown below pass?

Following unit tests fail. You need to implement the logic to pass these tests.

Solution:

Key Points If you are using Java 7, use Try with resources, which has the AutoCloseable interface…...

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

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

Click Here and check the contents with Try OR look for post titles with ♥

Log In | Register
Posted in member-paid, Passing the unit tests
1180+ members Prepare to succeed? | Reviews | Career PDFs | Self-taught Java developer?

800+ Interview Q&As ♥Free | ♦FAQ (Mouse Hover For Full Text)

open all | close all

200+ Java FAQs – Quick Prep

open all | close all

16 Java Key Areas to be a top-notch

open all | close all

80+ Java Tutorials – Step by step

open all | close all

100+ Java Coding Exercises

open all | close all

How good are your "Career Skills"?

open all | close all