Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the output of the third 'printin' statement in the main method? public class A { int i; static int s; public static void

image text in transcribed
What is the output of the third 'printin' statement in the main method? public class A { int i; static int s; public static void main(String[] args) { A a1 = new A(); System.out.println("A1.I is " + a1.i+"A1.s is " + a1.s); A a2 = a1; System.out.println("A2.i is " + a2.i + " A2.s is " + a2.s): A a3 = new AO; System.out.println("A3.i is " + a3.i + " A3.s is " + a3.s); } public A() { S++; } } A3.i is 2 A3.s is 3 O A3.iis 1 A3.s is 3 A3.i is 2 A3.s is 2 A3.i is 1 A3.s is 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

7. How will you provide encouragement and support?

Answered: 1 week ago

Question

Explain the factors affecting dividend policy in detail.

Answered: 1 week ago

Question

Explain walter's model of dividend policy.

Answered: 1 week ago