Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Java All : Operators (Arithmetic-Assignment-Unary-Relational-Logical)
Concept Learning Code Sheets

Sum of Inputs #557

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

Arithmetic Operators #3657

Addition, subtraction, multiplication, division and modulus operator

Simple Assignment and Compound Assignments #3661

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

Unary Operator Post and Pre Operations #3663

Understanding unary increment with post operation and pre operation example.

Relational operators usage for data comparison #3676

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.

Unary Operator plus, minus and inversion #3692

Understanding unary operator plus, minus and inversion.

Conditional or Logical Operators AND, OR #3698

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

Conditional Ternary Operators #3702

Understanding the use of conditional ternary operator with three operands

Operator precedence in arithmetic and unary expressions #3735

Understanding operator precedence with simple arithmetic and unary operators.

Operator precedence with brackets #3738

Understanding operator precedence when brackets are used.

Operator precedence with comparison and logical operators #3740

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

Auto conversion, Widening Type Promotion or Implicit Casting #3787

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

Exam Papers Problems

Precedence of Operator #3911

( As In Exam - ICSE2014 )

Operators with higher precedence are evaluated before operators with relative

Operators with higher precedence are evaluated before operators with relatively lower precedence. Arrange the operators given below in order of higher precedence to lower precedence.

(i) &&
(ii) %
(iii) >=
(iv) ++

Ternary Operator Evaluation Problem #3959

( As In Exam - ICSE2015 )

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

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

if-else to ternary conversion #4069

( As In Exam - ICSE2018 )

Rewrite the following using ternary operator:
if (bill>10000)

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

operator identification #4100

( As In Exam - ICSE2017 )

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

Name the operators listed below
(i) <     ( ii) ++      (iii) &&     (iv) ?:

division versus modulus operator #4104

( As In Exam - ICSE2017 )

Write one difference between / and % operator.

Write one difference between / and % operator.

difference between == and equals() #4220

( As In Exam - ICSE2016 )

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

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

if-else to ternary operator #4244

( As In Exam - ICSE2016 )

Rewrite the following using ternary operator :
if(x%2 == 0)
Syste

Rewrite the following using ternary operator :
if(x%2 == 0)
System.out.print(“EVEN”);
else
System.out.print(“ODD”);

Solved Problems

Increment, Decrement operator Output Writing #3666

Write output of the following program.

Write output of the following program.

Arithmetic operator with different data types Output Writing #3669

Write output of the following program.

Write output of the following program.

Assignment operators based Output Writing #3672

Write output of the following program.

Write output of the following program.

Relational operators based Output Writing #3682

Write output of the following program.

Write output of the following program.

Conditional Operator Output Value Proving #3704

Prove that output of the following program would be true.

Prove that output of the following program would be true.

Quizzes

Code Sheets:12  Exam Paper Problems:7  Solved Problems:5  Quizzes:6
Back