logo Sign In

Post #52249

Author
ricarleite
Parent topic
Code Wars: Return of the java
Link to post in topic
https://originaltrilogy.com/post/id/52249/action/topic#52249
Date created
7-Jun-2004, 2:39 AM
Quote

Originally posted by: Shimraa
what the null pointer bit again.


If that variable wasn't declared anywhere, then the compiler itself would stop and complain about this. If it has been declared, but not set any value, two things could happen: the compiler could get that thet variable was null and complain, or I belive it would throw a nullPointerException, since that variable is pointing to an unlocated memory area.

It has been a while since I've stoped programing in Java, so, I might be wrong on the exception thrown.

Here's a challenge for you: create a function in any coding that gets 3 numbers and orders then, but without using IF.