I have done do the code below for take 5 user input and print it out . Now i wanna to take the input from users and save it on to file, and retrieve it back . Pleas i need to explain who i can do this .
Thanks and regards
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class user_info {
public static void main(String[] args) throws Exception {
int i;
String Uname;
int UIDnum;
user_input[] input = new user_input[5];
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
for (i = 0; i < input.length; i++) {
input[i] = new user_input();
int number = i + 1;
System.out.println("User:" + number);
System.out.println("Please Enter your name:");
Uname = br.readLine();
input[i].setName(Uname);
System.out.println("Please Enter your ID number:");
UIDnum = Integer.parseInt(br.readLine());
input[i].setIDnum(UIDnum);
}
//char n = (char)UIDnum;
//String u = Integer.toString(UIDnum);
for (i = 0; i < input.length; i++) {
System.out.println("your name:" + input[i].getName());
System.out.println("your ID number:" + input[i].getIDnum());
}
}
}