MCQs > IT & Programming > JSharp - J# > What will happen on compiling and running the code?

JSharp - J# MCQs

A Student class extends Person class:
1        class Person
2        {
3                 int heightcm;
4
5                Person()
6                {        this.heightcm=160;         }
7        
8                int getHeight()
9                {        return heightcm;          }
10
11                String display()
12                {        return "Person height is " + heightcm; }
13        }

14        class Student extends Person
15        {
16                int studhtcm;
17                String className()
18                {        return "Student";        }
19
20                public static void main(String args[])
21                {
22                        Person obj = new Student();
23                        System.out.println(obj.getHeight());
24                        System.out.println(obj.display());
25                        System.out.println(obj.className());
26                }
27        }

What will happen on compiling and running the code?

Answer

Correct Answer:

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

More JSharp - J# MCQ Questions

search

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it