Java

 

class Base<T> { T obj; Base(T obj) { this.obj = obj; } T getob() { return obj; } } class Sub extends Base<String> { Sub(String str) { super(str); } String getob() { return obj; } }

How many methods of the sub-class in the above code snippet will have after compilation, and why? Let’s make it a little bit simpler: How many methods the sub-class will have, excluding the methods inherited from java.lang.Object?

Source de l’article sur DZONE

L’assistance proposée par ANKAA PMO

ANKAA PMO présent depuis plus de 20 ans sur le marché des services IT, accompagne les DSI dans leur recherche de compétences pour des besoins de renforts en mode régie ou l’externalisation de projets.
Vous souhaitez plus d’information ? Cliquez ici