Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A) Which super class method is overridden by a subclass. Give the method signature. B) Give an example of method overloading . Give the method
A) Which super class method is overridden by a subclass. Give the method signature.
B) Give an example of method overloading . Give the method signature of the two methods, and mention to which class do they belong to.
public classl Animal private int legs: private boolean hasBrain true: private String eat: public void eat) system.out.printin("Eats food !"); ) public void sleep System.out.print ("Animal sleeps!")Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started