Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the output of the following code: public class 01 { private int x = 55; private int y; public 01 ( ) {

image text in transcribed
What is the output of the following code: public class 01 { private int x = 55; private int y; public 01 ( ) { this.x = this.x + 1; this.y = this.x ; } public int getx () { return this.x; } public static void main(String[] args) { Q1 ti, t2, t3; t1 = new Q1(); t2 = new Q1 (); t3 = new Q1 ); System.out.print (t1.getX() + "," ); System.out.print (t2.getX() + "," ); System.out.println (t3.getX()); } } Select one: a. 56, 56, 56 b. 55, 55, 55, c. 56, 56, 56, d. Error

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