
3.12 Java Basics and Control Loops
Line Nos. 37 to 43: obtain values for three coefficients num1, num2, num3 form
keyboard. Notice that we have used try and catch blocks for detect-
ing any errors while reading input from keyboard using
System.
in
and BufferedReeader object.
3.8 Unary Operators
In unary operators, operator precedes a single operand. Unary operators are: unary minus (- ),
Increment and decrement operators : ++ , -- . . Examples are : - 4.0 , -5*(A+B)
++ i , i++ , --i , i—
Minus operator is both a unary and a binary operator. Unary minus, for example -5.0 oper-
ates on variable on its right, while the binary operator has variables ...