[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Basic Concepts - Discussion

Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion

34 / 64

What is the output for the below code ?

public class A {
int k;
boolean istrue;
static int p;
public void printValue() {
System.out.print(k);
System.out.print(istrue);
System.out.print(p);
}
}
public class Test{
public static void main(String argv[]){
A a = new A();
printValue();
}
}

A0 false 0

B0 true 0

C0 0 0

DCompile error - static variable must be initialized before use.

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here