About Question enthuware.ocpjp.v7.2.1184 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
evafang2008
Posts: 9
Joined: Fri Jun 26, 2015 11:15 am
Contact:

About Question enthuware.ocpjp.v7.2.1184 :

Post by evafang2008 »

What are the differences between autoboxing and type erasure?

If add option E "autoboxing", Can I select 'E autoboxing' as correct answer?

Thanks,

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1184 :

Post by admin »

No, autoboxing applies only to primitive wrappers, while type erasure applies to all generic classes. For example,
If you have a method that takes a raw List as an argument, you can use that method in code that uses, says,

Code: Select all

List<String> i.e. 
List<String> names;
...
printNames(names); 

---
void printNames(List names){ ... }
HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests