64 752
Assignments Done
99,3%
Successfully Done
In September 2018

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?
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions