This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Array Question" Watch "Array Question" New topic
Author

Array Question

Minu Sam
Greenhorn

Joined: Apr 26, 2012
Posts: 10
All,

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: http://aspose.com/file-tools
 
subject: Array Question
 
Similar Threads
array
Adding elements of two arrays
Final arrays and initialisation
Concatenating two String arrays
Printing in Array in Ascending order