Category : Java | Sub Category : Operator | By Prasad Bonam Last updated: 2020-09-28 13:29:23 Viewed : 509
/**
* Write a programme left
shifting the byte value.
*
*/
public class
ByteShift { // class name
public static void
main(String args[]) { // main body of programme start from here
byte
a = 64, b; // Declare a
int
i; // declare i
i = a << 2; //
Decare i is lessthan 2
b = (byte)
(a << 2); // convert data type
System.out.println("orignal
value of a: " + a); // print value of a
System.out.println("i
and b:" + i + " "
+ b); // print value of i and b
} //
main of main programme
} // end of class
orignal value of a: 64