Page 107 - Cs_withBlue_J_C11_Flipbook
P. 107
Step 13: Right-click on the red object name and select the method sumaverage().
Step 14: Input the values in the respective text box and click on the OK button. The output will be shown in the
“Terminal Window”.
4.6 ERRORS IN JAVA PROGRAMS
While solving a Java problem, we sometimes come across certain situations or a code that results in an unpredictable
result and execution is stopped or outputs a wrong answer. These are known as errors in Java. It gives rise to an
exception. It should be debugged while testing the program.
Definition
During execution of a program, the occurrence of any error stops the execution. This situation is known as an
exception.
105
Introduction to Object-Oriented Programming Using Java 105

