Answer to Question #15376 in Java | JSP | JSF for Royce

Question #15376
ArrayList<Double>a;
a=new ArrayList<Float>();

What is the error in the code segment?
1
Expert's answer
2012-09-27T11:01:02-0400
You must use only object types in generic class. Example:
a=new ArrayList<Float>() where Float - object type (float - simple type)

Likewise you must use Integer, Double, Long, Byte, String etc.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS