|
-
Dec 5th, 2001, 04:19 PM
#1
Thread Starter
Hyperactive Member
Null Test [resolved]
how can you test if a primitive has not been intialized?
" " " " " " reference " " " " ?
Last edited by CaptainPinko; Dec 8th, 2001 at 03:55 PM.
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Dec 5th, 2001, 05:13 PM
#2
the compiler should throw an error if there is a chance a primitive wasn't initialized, so there really is know need for that.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 5th, 2001, 06:27 PM
#3
Thread Starter
Hyperactive Member
alirght, but what if i need to know if a reference is set to null?
<which i do>
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Dec 5th, 2001, 06:30 PM
#4
what do you mean by reference? Like if an object is passed into a function and is null?
public void doSomething(Object o)
{
if (o == null)
{
System.out.println("Null!!");
return;
}
}
??
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 5th, 2001, 06:35 PM
#5
Thread Starter
Hyperactive Member
i'm a dumbass
i thought it was gonna be something more difficult. LMFAO!
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|