I'm writing a Java code to enter and display Name,age,address....
I want to check if user don't enter their name,age or address it will display an error message.
I use lenght() method to check their name and address. But it raise error with age ( int data type ). Why is this ?
p/s: I can change age variable to String data type to implement code. But i still want keep it data type ( int ), how to check it is entered or not ?
I want to check if user don't enter their name,age or address it will display an error message.
I use lenght() method to check their name and address. But it raise error with age ( int data type ). Why is this ?
p/s: I can change age variable to String data type to implement code. But i still want keep it data type ( int ), how to check it is entered or not ?