Java Notes

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

Percentage pass or fail

Find square 1 to 5
Find even number

While is entry control loop

Do while is exit control loop


Checking at last
Do while
While loop

For loop
Decrement--
Multiple variable
Assume a=10 and b=5

 (a<<2) + (b>>2) 
 (b>0) 
 (a+b*100) /10 
 a&b
 public class Exp1
 {
    public static void main(String args[])
    {
       int a=10,b=5;
       System.out.println("(a<<2)+(b>>2): "+((a<<2)+(b>>2)));
       System.out.println("(b>0): "+ (b>0));
       System.out.println("(a+b*100)/10 :"+((a+b*100)/10));
       System.out.println("(a&b): "+ (a&b));
     }
 }

Output

(a<<2)+(b>>2): 41

(b>0): true

(a+b*100)/10 :51

(a&b): 0

Array

You might also like