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 doesnt refer to an Integer object, so theres no value to unbox.