What are the differences between autoboxing and type erasure?
If add option E "autoboxing", Can I select 'E autoboxing' as correct answer?
Thanks,
About Question enthuware.ocpjp.v7.2.1184 :
Moderator: admin
-
- Posts: 9
- Joined: Fri Jun 26, 2015 11:15 am
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1184 :
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,
HTH,
Paul.
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){ ... }
Paul.
Who is online
Users browsing this forum: Google [Bot] and 5 guests