How do i pass the variables "mname","mtype", "mID" ect out of this class and into another class
where it is required. I require them in an abstract class where they will be printed to a file.
I need a solution ASAP. Cheers, here is my problem.....
class MJInput
{
public void InputHere()
{
BufferedReader userinput = new BufferedReader(new InputStreamReader(System.in));
try
{
System.out.println("------------Military Jet Information------------\n");
System.out.println("Welcome, please answer the following questions:-\n");
System.out.print("Aircraft Name:- ");
String mname = userinput.readLine();
System.out.print("Aircraft Type:- ");
String mtype = userinput.readLine();
System.out.print("Aircraft ID Number:- ");
int mID = Integer.parseInt(userinput.readLine());
System.out.print("Aircraft Capacity:- ");
int mcapacity = Integer.parseInt(userinput.readLine());
System.out.println();
userinput.close();
}
catch(IOException ioe)
{
System.out.println("Error:- " + ioe);
}
}
}