Menu
Question Index
...

What will be the output of the following program?

public class FindName {
    public static void main(String[] args) {
        Test a = new Test();
        Class myClass = a.getClass();
        System.out.println("My class name is " + myClass.getName());
    }
}
class Test {
}


My class name is FindName
My class name is Test
Compilation Error
Runtime Error

Doubts

Problems

Topic: java.lang.class - Java Library

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App