Question: Analyze the following code: public class A { String s; public A(String s) { System.out.println(A1:+s); } public static void main(String[] args) { A a =
Analyze the following code: public class A { String s; public A(String s) { System.out.println("A1:"+s); } public static void main(String[] args) { A a = new A("s"); System.out.println("A2:"+a.s); } } The program prints "A1:null" and "A2:null". The program prints "A1:s" and "A2:null". The program prints "A1:null" and "A2:s". The program prints "A1:s" and "A2:s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
