logo

Crowdly

What is the output of this program class Person{ String name; Person(){ ...

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

What is the output of this program

class Person{

String name;

Person(){

name="John";

}

}

class Employee extends Person{

int age;

Employee(){

age=34;

}

}

class Customer extends Person{

int salary;

Customer(int salary){

this.salary=salary;

name="Maddy";

}

public void displayDetails(){

System.out.println(name+age+salary);

}

}

class Account {

public static void main(String[] args) {

Customer c=new Customer(20000);

c.displayDetails();

}

}

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!