Java Data Type How to - Declare integer literals as octal values


We would like to know how to declare integer literals as octal values.


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.

public class MainClass{

  public static void main(String[] a){
     int octValue = 036;


The code above generates the following result.