Blog Archives

♥ Overloaded methods Vs Generic methods in Java with JD-GUI & javap to look under the covers

In an earlier post we looked at Understanding Overriding, Hiding, and Overloading in Java?. We also discussed how “method overriding” gives polymorphism. In this post, let’s see how a “generic method” can replace a number of overloaded methods. Then see under the hood as to what happens to the compiled

Read more ›

Posted in Generics
Tags:

♦ 7 rules to remember on Java Generics for better understanding

Here are 7 rules to remember regarding Java Generics to understand Generics and handle interview and coding questions on Core Java. Object <– Fruit <– (Orange, Mango, etc siblings) Rule 1: Java generics differ from C++ templates. Java generics (at least until JDK 8), generate only one compiled version of…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Generics, member-paid

♥♦ Java Generics in no time “? extends” & “? super” explained with a diagram

Generics in Java can be be a bit tricky to get your head around. Hope the explanation below enhances your understanding of generics. This complements 3 scenarios to get a good handle on Java generics. Plain old List, List <Object>, and List<?> The plain old List: is a heterogeneous mixture

Read more ›

Posted in Generics, Understanding Core Java
Tags: ,

3 scenarios to get handle on Java generics

Q1. If java.lang.Object is the super type for java.lang.Number and, Number is the super type for java.lang.Integer, am I correct in saying that List<Object> is the super type for List<number> and, List<Number> is the super type for List<Integer>. A1. No. List<Object> is not the the super type of List<Number>. If that

Read more ›

Posted in Generics

♦ 12 Java Generics interview Q&A

Q1 What do you understand by the term type erasure with regards to generics? A1. The term type erasure is used in Java generics. In the interest of backward compatibility, robustness of generics has been sacrificed through type erasure. Type erasure takes place at compile-time. So, after compiling List and…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Generics, member-paid
Tags: , ,

800+ Interview Q&As ♥Free|♦FAQ (Mouse Hover for Full Text)

open all | close all

200+ Java FAQs – Memory Joggers

open all | close all

16 Java Key Areas to be a top-notch

open all | close all

80+ Java Tutorials – Step by step

open all | close all

100+ Java Coding Exercises

open all | close all

How good are your "Career Skills"?

open all | close all