Posts Tagged ‘Beginning Java’

Beginning Java Programming: The Object-Oriented Approach Chapter 5 Addition with a Loop

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates a shorter way of doing a sales calculation by using a loop to add the sales of a product in each month of 2014. Click “View Project” to run the example in your browser or edit the […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 Calculating Addition

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates a “long way” of doing a sales calculation. It prints the total sales of a product in 2014 by adding up the sales of that product in each month of 2014. Click “View Project” to run the […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 compareTo() method

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates how to compare strings using the compareTo() method of the String class. Click “View Project” to run the example in your browser or edit the code and then click “View Project” to run it with your changes. […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 Compare Strings

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates how to compare strings in Java. Click “View Project” to run the example in your browser or edit the code and then click “View Project” to run it with your changes. You can download the complete code […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 Switch-Case

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates the switch-case keywords. It prints different interest rates based on the loan type. Click “View Project” to run the example in your browser or edit the code and then click “View Project” to run it with your […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 Controlling with Return

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates how to break out of a loop using the return keyword directly. The example searches for an employee id in an employees array. When an employee is successfully found, the findEmployee() function simply returns true, thereby breaking […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 Controlling with Break

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates another use of the break keyword and example searches for an employee id in an employees array. When an employee is successfully found, it breaks out of the loop thereby saving considerable execution time. Click “View Project” […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 Break Keyword

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates the break keyword. Specifically it demonstrates three nested loops: a nested loop with no break, a nested loop with an unlabelled break, and a nested loop with a labelled break. Click “View Project” to run the example […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 – Do While Loop

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates a do while loop. It displays the multiplication table. Click “View Project” to run the example in your browser or edit the code and then click “View Project” to run it with your changes. You can download […]

Tags:

Beginning Java Programming: The Object-Oriented Approach Chapter 5 – While Loop

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 5. This example demonstrates a while loop. It displays the multiplication table. Click “View Project” to run the example in your browser or edit the code and then click “View Project” to run it with your changes. You can download the […]

Tags: