Below is the code:
class PlayWithBinary {
static int age;
public static void main (String args[]){
int i = 0b10101010;
System.out.println("my age is: " + age + " my salary is: "+ i);
}
}
In terminal I executed : javac PlayWithBinary.java
For some reasons it is showing this error message:
PlayWithBinary.java:5: ';' expected
int i = 0b10101010;
^
1 error
Any ideas?
Update: for those who are getting similar errors, here is the link to download JDK 8 - Java SE Development Kit 8 Downloads