There are 3 java classes in separate files and when I compile them...ERRORS!
If anyone could run those 2 classes separately and tell me the peoblems I will be really grateful coz I've used up my minds!
import java.util.*;
public class PageOne
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
private int option = 0;
RegisterTest entry = new RegisterTest();
System.out.println("--Welcome To The Owned Application--");
System.out.println("1. Login");
System.out.println("2. Register");
System.out.println("");
System.out.print("Enter Your Choice : ");
option = sc.nextInt();
switch(option)
{
case 1:
case 2: entry.Test2();
break;
default: System.out.println("Invalid Option...Enter Again");
System.out.println("");
System.out.print("Enter Your Choice : ");
option = sc.nextInt();
break;
}
}
}
import java.util.*;
import java.io.*;
public class Register
{
private String userEmail;
private String name;
private String password;
private int option;
private String inviterEmail;
private int dollars;
public Register()
{
userEmail = "";
name = "";
password = "";
option = 0;
inviterEmail = "";
dollars = 200;
}
public void setUserEmail(String newUserEmail)
{
userEmail = newUserEmail;
}
public void setName(String newName)
{
name = newName;
}
public void setPassword(String newPassword)
{
password = newPassword;
}
public void setOption(int newOption)
{
option = newOption;
}
public void setInviterEmail(String newInviterEmail)
{
inviterEmail = newInviterEmail;
}
public void Test1()
{
try {
FileOutputStream fOutputStream = new FileOutputStream("C:\\Documents and Settings\\mayank.a.2007\\Desktop\\SMU - 2nd Semester\\Object Oriented Application Development\\Project Facelift\\Code\\Database.txt");
Scanner sc = new Scanner(System.in);
fOutputStream.write(userEmail);
fOutputStream.write(name);
fOutputStream.write(password);
fOutputStream.write(option);
fOutputStream.write(inviterEmail);
fOutputStream.write("");
fOutputStream.close();
}
catch(FileNotFoundException e) {
System.out.println("Error Opening The Input File!" + e.getMessage());
System.exit(0);
}
catch (IOException e) {
System.out.println("IO Error!" + e.getMessage());
e.printStackTrace();
System.exit(0);
}
}
}
import java.util.*;
public class RegisterTest
{
public void Test2()
{
Register user = new Register();
Scanner sc = new Scanner(System.in);
private String userEmail;
private String name;
private String password;
private int option;
private String inviterEmail;
System.out.print("Enter Your Email : ");
userEmail = sc.nextLine();
System.out.print("Enter Your Name : ");
name = sc.nextLine();
System.out.print("Enter Your Password : ");
password = sc.nextLine();
System.out.print("Looking For ");
System.out.print("1 - Friendship");
System.out.print("2 - Dating");
System.out.print("3 - Relationship");
System.out.print("4 - Networking");
System.out.print("Enter Your Option : ");
option = sc.nextInt();
System.out.print("Enter Inviter's Email : ");
inviterEmail = sc.nextLine();
user.setUserEmail(userEmail);
user.setName(name);
user.setPassword(password);
user.setOption(option);
user.setInviterEmail(inviterEmail);
user.Test1();
}
}
WAITING.......................:)