class Lab14b { int a,b; public static void main(String args[]) { Lab14b x=new Lab14b(); x.a=17; x.b=46; System.out.println("a="+x.a+",b="+x.b); change(x); System.out.println("A er changing..."); System.out.println("a="+x.a+",b="+x.b); } public static void change(Lab14b A) { A.a=46; A.b=17; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter