aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Error on K&B book (Java 6) page 579 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Error on K&B book (Java 6) page 579" Watch "Error on K&B book (Java 6) page 579" New topic
Author

Error on K&B book (Java 6) page 579

Bhaarat Sharma
Ranch Hand

Joined: Jun 04, 2007
Posts: 96
I believe there is an error on page 579 in the toArray() section


Now let's take a look at the toArray() method. There's nothing too fancy going
on with the toArray() method; it comes in two flavors: one that returns a new
Object array, and one that uses the array you send it as the destination array:


the line


will throw an Incompatible types error because required is Integer[] and found is Object[]

Have other people noticed this as well or am I doing something wrong?

omnipresent
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Hi, it complies and runs. It seems to be a fine widening conversion of iL.

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Bhaarat Sharma
Ranch Hand

Joined: Jun 04, 2007
Posts: 96
My fault.

I see my mistake. I guess its time to hit the bed for me.

Thanks
-bhaarat
shivdhwaj pandey
Ranch Hand

Joined: Nov 12, 2011
Posts: 67

go and take proper sleep dude


with regards,
Shivdhway Pandey
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error on K&B book (Java 6) page 579