About Question com.enthuware.ets.scjp.v6.2.582 :

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

Moderator: admin

Post Reply
ETS User

About Question com.enthuware.ets.scjp.v6.2.582 :

Post by ETS User »

It is said in explanation, that this

Code: Select all

Object[] o = new int[10]; 
is not valid. But why?

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

Re: About Question com.enthuware.ets.scjp.v6.2.582 :

Post by admin »

Because an int is a primitive data type and primitive data types are not Objects. So an array of ints is not an array of Objects.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests