Append L to the literal.
public class MainClass { public static void main(String[] a) { long hexLongValue = 0x0FL; System.out.println(hexLongValue); } }
15