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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!