Menu
Question Index
...

What will be the output of the following program?

public class ClassTest {
    public static void main(String[] args) {
        System.out.println("Class ClassTest");
    }
    public static class A {
        A() {
            System.out.println("Class A");
        }
    }
    public static class B {
        B() {
            System.out.println("Class B");
        }
    }
}


Class ClassTest
Class A
Class B
Class ClassTest
Class A
Class ClassTest
Class B
Class A
Class B
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Multiple Methods In One Class Creating Static Methods In Java Using Static Keyword

Read this topic Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App