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
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
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
English,
3 months ago
History,
3 months ago
Computer Science,
3 months ago
English,
7 months ago
Social Sciences,
7 months ago
Biology,
1 year ago
Biology,
1 year ago