It's helpful in these little study programs to 1) make them as simple as possible, and 2) to over-instrument them to see what's going on. To simplify, eliminate the instance creation. It doesn't add to the study. To over-instrument, add a few print statements to check the values of variables of interest. In the end, something like:
public class TestClass
{
public static void main(String[] args)
{
int i = 5;
inc(i);
System.out.println( "i in main() = " + i );
} // end method main()
public static void inc ( int k )
{
k++;
System.out.println( "k in inc() = " + k );
} // end method inc()
} // end class TestClass