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:
Tim Cooke
Campbell Ritchie
Ron McLeod
Junilu Lacar
Liutauras Vilda
Sheriffs:
Paul Clapham
Jeanne Boyarsky
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Piet Souris
Carey Brown
Bartenders:
Jesse Duncan
Frits Walraven
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
array store exception
gurpreet singh
Ranch Hand
Posts: 38
posted 15 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 15 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>
;
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
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...