Computer Science, asked by shalukanwar, 7 months ago

Question- What will be the output?
class car
{
public void Show()
{
System.out.println("Brand is not defined yet");
}
}
class mercedes extends car
{
public void Show()
{
System.out.println("It's mercedes");
}
Class Benz extends mercedes
}
}
public class main()
{
Public static void
main(String[] args)
{
car obj = new Benz():
obj Show():
}
}

A. Compile Time Error
B. Run Time Error
C. It's Mercedes
D. Brand is not defined yet​

Answers

Answered by raj544830
4

Answer:

what is this

Explanation:

class mercedes extends car

{

public void Show()

{

System.out.println("It's mercedes");

}

Class Benz extends mercedes

}

}

public class main()

{

Public static void

main(String[] args)

{

car obj = new Benz():

obj Show():

}

}

A. Compile Time Error

B. Run Time Error

C. It's Mercedes

D. Brand is not defined yet

Answered by lavis7890
1

Answer:

Question- What will be the output?

class car

{

public void Show()

{

System.out.println("Brand is not defined yet");

}

}

class mercedes extends car

{

public void Show()

{

System.out.println("It's mercedes");

}

Class Benz extends mercedes

}

}

public class main()

{

Public static void

main(String[] args)

{

car obj = new Benz():

Similar questions