public class Examp { public static void main(String[] args) { int i = 5; Examp examp_object = new Examp(); examp_object.inc(i); System.out.println(i); } public void inc (int k) { k++; } }
For my surprise, the result is appearing to be 5. Why is that?


LinkBack URL
About LinkBacks
Reply With Quote