Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
array store exception
gurpreet singh
Ranch Hand
Posts: 38
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello frnds,
pls explain why does
Object[] objArr = new
String
[10];
objArr[0] = new Long(); // compiles; fails at runtime
but
String[] objArr = new String[10];
objArr[0] = new Long(); // gives compile time exception
SCJP
Dan Polak
Ranch Hand
Posts: 32
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Long IS A Object, but Long IS NOT A String
<a href="http://www.dantheman.pl" target="_blank" rel="nofollow">
http://www.dantheman.pl</a>
;
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Generic arrays
Collection toArray( T[ ] ) method
String to Object array
MessageFormat
Need more info on toArray(Object[])
More...