how do i completely erase any value from an integer vairable?
this does not work:
Code:theint = null;
Printable View
how do i completely erase any value from an integer vairable?
this does not work:
Code:theint = null;
I didn't notice that working in c/c++ except when using NULL instead of null, but in Java, you might use an Integer object which wraps an int primitive; then you can set the Integer object to null.
Yes VirtuallyVB is right. The literal value NULL is used to
identify the fact that an Object is not assigned to a variable.... It can be used with any variable that is not
of a primative data type.... and int is a primative data type.
I was wondering this too, I was trying to use it to ckeck a text field to see if the user did not enter any input when a button is pressed.
TextField
public String getText()
String
public int length()
Code:TextField aTextField;
...
int theint = aTextField.getText().length();
if(theint == 0){
//Then the user did not enter any input when a button is pressed.
}