This is a program to learn different ways of getting the desired console output

Java All : Operators (Arithmetic-Assignment-Unary-Relational-Logical)

This is a program to learn different ways of getting the desired console output

Addition, subtraction, multiplication, division and modulus operator

Using simple assignment means = operator and special variations with arithmetic operators like +=, -=, *=, /= and %= .

Understanding unary increment with post operation and pre operation example.

Use of equality check operator == and other relational operators like not equal to !=, less than < , greater than > , less than or equal to <= and greater than or equal to >= operators.

Understanding unary operator plus, minus and inversion.

Understanding the use of condition operators and (&&) and or (||)

Understanding the use of conditional ternary operator with three operands

Understanding operator precedence with simple arithmetic and unary operators.

Understanding operator precedence when brackets are used.

Understanding operator precedence with comparison(relational) and logical(conditional) operators.

Understanding rules of widening type promotions from byte->short->int->long->float->double.

Write output of the following program instructions.
int a=10;
System.out.println(a++); ...

Write output of the following program instructions.
int a=5;
float b=9.0f;
double c= ...

Write output of the following program instructions.
int a=10;
int b=a=12;
System.out. ...

Write output of the following program.

class SP_RelationalOP { public static voi ...

Prove that output of the following program would be true.

class SP_Conditi ...

Operators with higher precedence are evaluated before operators with relatively lower prec ...

What is the value of x1 if x=5?
x1= ++x – x++ + --x ...

Operators with higher precedence are evaluated before operators with relatively lower prec ...

Evaluate the value of n if the value of p=5, q=19
int n = (q-p) > (p-q) ? (q-p) : (p-q ...

Rewrite the following using ternary operator:
if (bill>10000)
discount=bill*10.0/100; ...

Name the operators listed below
(i) < ( ii) ++ (iii) && (i ...

Write one difference between / and % operator. ...

State the difference between == operator and equals() method. ...

Rewrite the following using ternary operator :
if(x%2 == 0)
System.out.print("EVEN");
e ...

What is the value of x1 if x=5?
x1= ++x – x++ + --x ...

Code Sheets:12 Solved Problems:7 Exam Questions:8 Quizzes:6

×