Solved

Consider the Checker Class Below. Public Class Checker

Question 90

Multiple Choice

Consider the Checker class below. public class Checker
{
Public static int count = 0;
Public int number = 0;
Public Checker()
{
Count++;
Number = count;
}
Public int getCount() { return count; }
Public int getNumber() { return number; }
}
What is output from the code fragment below?
Checker one = new Checker() ;
Checker two = new Checker() ;
System.out.println(one.getCount() + " " + two.getCount() ) ;


A) 2 2
B) 1 1
C) 1 2
D) 2 1

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents