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