Question
What is the output for the below code ?
interface A{
public void printValue();
}
1. public class Test{
2. public static void main (String[] args){
3. A a1 = new A(){
4. public void printValue(){
5. System.out.println("A");
6. }
7. };
8. a1.printValue();
9. }
10. }
interface A{
public void printValue();
}
1. public class Test{
2. public static void main (String[] args){
3. A a1 = new A(){
4. public void printValue(){
5. System.out.println("A");
6. }
7. };
8. a1.printValue();
9. }
10. }
Answer: Option B
Submit Your Solution Below and Earn Points !
Submit Your Solution Below and Earn Points !
Submit Solution