Shift int left
public class Shifting {
public static void main(String[] argv) {
System.out.println(" 2<<4 = " + (2<<4));
System.out.println(" 2<<8 = " + (2<<8));
System.out.println("2<<16 = " + (2<<16));
System.out.println("2<<24 = " + (2<<24));
System.out.println("2<<31 = " + (2<<31));
System.out.println("2<<32 = " + (2<<32));
System.out.println("2<<31 = " + ((long)2<<31));
System.out.println("2<<32 = " + ((long)2<<32));
}
}
Home
Java Book
Runnable examples
Java Book
Runnable examples
Data Type Int:
- Create Integer from int value
- Convert Integer to Binary String
- Convert int to String
- Convert octal number to decimal number
- Convert binary number to decimal number
- Convert decimal integer to octal number
- Convert decimal integer to hexadecimal number
- Convert hexadecimal number to decimal number
- Convert integer to readable format
- Convert Integer object to Numeric primitive types
- Shift int left
- Shift int Right
- Unsigned shift int right
- Min and Max values of datatype int
- Int Overflow
- Add two integers, checking for overflow.