[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 :: Packages - Discussion

Home > JAVA Programming > Packages > MCQs Questions Discussion

1 / 6

What is the output for the below code?

public class D {
int i;
int j;
public D(int i,int j){
this.i=i;
this.j=j;
}
public void printName() {
System.out.println("Name-D");
}
}
public class Test{                                                                                                                                                            13. public static void main (String[] args){
D d = new D();
d.printName();
}
}

AName-D

BCompilation fails due to an error on lines 3

CCompilation fails due to an error on lines 4

DCompilation succeed but no output

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!