Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Check a variable ( int data type ) length

$
0
0
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 ?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>