JAVA Programming :: Packages - Discussion

Home > JAVA Programming > Packages > MCQs Questions Discussion

6 / 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!