Solved

Public Class Secret

Question 30

Multiple Choice

public class Secret
{
Private int x;
Private static int y;
Public static int count;
Public int z;
Public Secret()
{
X = 0;
Z = 1;
} public Secret(int a)
{
X = a;
} public Secret(int a, int b)
{
X = a;
Y = b;
} public String toString()
{
Return ("x = " + x + ", y = " + y + ",
Count = " + count) ;
} public static void incrementY()
{
Y++;
}
}Based on the class in the accompanying figure, which of the following statements is illegal?


A) Secret.incrementY() ;
B) Secret.count++;
C) Secret.z++;
D) Secret secret = new Secret(4) ;

Correct Answer:

verifed

Verified

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

Related Questions