Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Input validation in java class

807589Aug 18 2008 — edited Aug 18 2008
Hello all,

In my class file i have an input value. I want to check whether that value is null or not. If that value is null i want the user to re enter the value for that input parameter. How its possible. My class file is given below.

"
InputStreamReader inputStreamReader = new InputStreamReader(System.in);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String input = bufferedReader.readLine();
"

if input is null then i want him to re enter the value again.

regards
Jithesh PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2008
Added on Aug 18 2008
4 comments
277 views