logo

Crowdly

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

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

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;}

}

 

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.medtech.tn?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!