File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Array Question 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 "Array Question" Watch "Array Question" New topic

Array Question

Minu Sam

Joined: Apr 26, 2012
Posts: 10

Please look below:I have question why is the last line( arr2 = (int[])o1; ) in the code..not a compile time error rather it is a runtime error.

Will appreciate any input.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Because ClassCastException extends RuntimeException. It will be resolved at runtime.

ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
I agree. Here's the link:
subject: Array Question
It's not a secret anymore!