This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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!