Defining integer literals as octal values

Java Programming Language / Variables in java

2106

Program:

public class integerLiteralsAsOctal {

  public static void main(String[] a){
     int octValue = 036;
     System.out.println(octValue);
  }

}

/*
Octal values is base 8
Legal digits in an octal literal can be from 0 to 7
Octal literals are with a leading zero, for example 035 and 067
*/

Output:

30
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.