logo

Crowdly

Browser

Add to Chrome

What is the output of the following code snippet? class Person{ String name; ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What is the output of the following code snippet?

class Person{

String name;

Person(){

  System.out.println("In Person class");

  }

}

class Student extends Person{

Student(){

  System.out.println("In Student class");

  }

int id;

public static void main(String[] a){

Student ob=new Student(); //Line 1

ob.name="abc"; //Line 2

ob.id=123;}

}

 

More questions like this

Want instant access to all verified answers on moodle.medtech.tn?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome