java polymorphism pls inspect the vode | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

java polymorphism pls inspect the vode

public class Test { public void m(){ System.out.println("super"); } } class V extends Test{ @Override public void m(){ System.out.println("subc"); } public static void main(String[] args){ Test t=new V(); t.m(); } }

9th Jul 2018, 9:15 PM
Abdulahi Salaudeen
2 Réponses
0
ok i got you thanks looks like i was the ome that thinks of limits the limit.. bcus i saw a similar question with the arraylist which implement list interface when creating object with it the reference provided is that of the list so i didn't get it and i also read about it extending or implementing Serialization? Donna
10th Jul 2018, 5:19 AM
Abdulahi Salaudeen
0
then Donna what is the difference between the super class reference and subclass reference it that where my mistake is.
10th Jul 2018, 6:04 AM
Abdulahi Salaudeen