public class MainClass{ static Integer x; public static void main(String [] args) { doStuff(x); } static void doStuff(int z) { int z2 = 5; System.out.println(z2 + z); } } x doesn’t refer to an Integer object, so there’s no value to unbox.