Menu
Question Index
...

What will be the output of the following program?

public class Phone {
    public static void main(String[] args) {
        Class Call;
        Phone p = new Phone();
        Call = p.getClass();
        System.out.println(Call);
        System.out.println(Call.getName());
    }
}


class Phone
Phone
Phone
Phone
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