Menu
Question Index
...

Which of the following statement is used at LINE K to print the message "Hello MeritCampus"?

public class InsertLine extends SuperClass {
    public static void main(String[] args) {
        InsertLine object1 = new InsertLine();
        object1.printMsg();
    }
    public void printMsg() {
        //LINE K
    }
}
class SuperClass {    MC obj_MC = new MC();    }
class MC {    String str = "Hello MeritCampus";    }


System.out.println(MC.str);
System.out.println(str);
System.out.println(this.obj_MC.str);
Some other statement

Doubts

Problems

Topic: Is-A Relationship In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App