Question: write java code and also show the output of code Suppose a class 'A' has a static method to print Parent. Its subclass 'B' also
write java code and also show the output of code
Suppose a class 'A' has a static method to print "Parent". Its subclass 'B' also has a static method with the same name to print "Child". Now call this method by the objects of the two classes. Also, call this method by an object of the parent class referring to the child class i.e. A obj = new B ()
Step by Step Solution
3.35 Rating (161 Votes )
There are 3 Steps involved in it
Answer Java code Class A Super class class A public st... View full answer
Get step-by-step solutions from verified subject matter experts
