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
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Programmer Certification (OCPJP)
setting int to null
Martin Petransky
Greenhorn
Posts: 15
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi there,
I just came across an interesting (at least for me) one that i would like to share.
This obviously won't compile:
int a = null;
But this will, as the null will be boxed to Integer, and you will get.. Of course, NumberFormatException at runtime.
int a = (true) ? null : 1;
OCPJP 6, OCEWCD 6
Kaydell Leavitt
Ranch Hand
Posts: 694
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Wow, that's amazing. It must be auto-boxing the result, but I would have sworn it wouldn't have compiled!
(I got a NullPointerException though.)
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Problem in Arrays passing.
array declaration
Arrays
Values of Hash Map to be 2-dimensional array
exception while running code
More...