Hi,
I have a class which asks user to input information using scanner.
e.g.
-
System.out.println("Please enter your post code: ");
-
String postCode = myScanner.nextLine();
-
-
System.out.println("Please enter your telephone (+44): ");
-
long telNumber = myScanner.nextLong();
-
now at present, after the input request i call a new object, but rather that the current static information, i want it to be these variables
currently
- Personal[] personalList = new Personal[1];
-
personalList[0] = new Personal("Paul "," White ", 74078L , "my address", "my town", "my county", 7383383838L);
bet i want to pass in the actual variable value of the scanned item.
within the object class Personal, the constructor looks like this
-
public Personal(String forename, String surname, long dob, String add1, String add2, String county, long telNumber)
-
{
-
this.forename = forename;
-
this.surname = surname;
-
this.dob = dob;
-
this.add1 = add1;
-
this.add2 = add2;
-
this.county = county;
-
this.telNumber = telNumber;
-
-
}
-
-