public class Tester { final short s = 12; // Line 3 static void swap( Tester obj) { obj.s = 11; // Line 6 } public static void main(String[] args) { final Tester obj1 = new Tester(); swap(obj1); System.out.print(obj1.s); // Line 12 } }
final short s = 12; // Line 3
static void swap( Tester obj) {
obj.s = 11; // Line 6
}
public static void main(String[] args) {
final Tester obj1 = new Tester();
swap(obj1);
System.out.print(obj1.s); // Line 12
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.