J2EEOnline J2EE

Java Certification  «Prev  Next»
Lesson 1
Flow control and exception handling
Statements are the brick and mortar from which programs are built. Because of their importance, Oracle has dedicated a entire exam topic to them: "Flow Control and Exception Handling." The good news is that Java's programming statements are easy to master, and with a little study, you should do well on this part of the exam. Another major exam topic covered in this module is garbage collection, also well-defined and easy to master.
Module objectives
This module will help you to satisfy the following exam objectives:
Flow control and exception handling
  1. Write code using if and switch statements and identify legal argument types for these statements.
  2. Write code using all forms of loops, including labeled and unlabeled use of break and continue, and state the values taken by loop counter variables during and after loop execution.
  3. Write code that makes proper use of exceptions and exception handling clauses (try catch finally) and declares methods and overriding methods that throw exceptions.
Garbage collection
  1. State the behavior that is guaranteed by the garbage collection system and write code that explicitly makes objects eligible for collection.

We all make multiple decisions on a daily basis, and we often have to choose from a number of available options to make each decision. These decisions range from the complex, such as selecting what subjects to study in school or which profession to choose, to the simple, such as should I use a neural network.
The option you choose that leads to a decision can potentially change the course of your life, in a small or big way. For example, if you choose to study medicine at a university, you have the option to become a research scientist; if you choose fine arts, you have the option to become a painter.
You may also repeat particular sets of actions. These actions can range from studying mathematics every day to using a messaging app to connect with a friend, or passing exams at school or university in order to achieve a desired degree.
In Java, the selection statements (if and switch) and looping statements (for, enhanced for, while, and do-while) are used to define and choose among different courses of action, as well as to repeat lines of code. You use these types of statements to define the flow of control in code.