+ 2
What is type eraser in java
5 Answers
+ 4
Type erasure is the technique using which the Java compiler translates generic/parameterized type to raw type in Java generics.
+ 3
for example List<Long>list=new ArrayList<Long>() ;list. add(Long. valueOf(1));list.add(Long.valueOf(2));
+ 3
In the above example a list is created which can only contain elements of type Long and if you try to add any other type of element to this list, it will give you compile time error.
+ 2
Its my pleasure and thanks to you asking a good question
+ 1
thanks Rajeshwari for sharing valuable answers.