Monday, June 23, 2014

Java Code To Perform Read/Write operation

import java.util.Scanner;

public class ReadWrite {

public static void main(String[] args) {

int num = 1;
String val = "aa";

Scanner input = new Scanner (System.in);

while ( num != 0) {

System.out.println ("Enter Number: ");
num = input.nextInt();
System.out.println ("You Entered: " + num);

}
  while (! val.equalsIgnoreCase("e")) {

System.out.println ("Enter String Value: ");
val = input.next();
System.out.println ("You Entered: " + val);

}
}
}

No comments:

Post a Comment