MCQs > IT & Programming > Java > Why would the following code snippet not compile successfully? if (mangoList instanceof List) { System.out.println(«true»); }

Java MCQs

Why would the following code snippet not compile successfully?

if (mangoList instanceof List<Mango>) { System.out.println(«true»); }

Answer

Correct Answer: Generic types are erased before runtime.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it