I am trying to print out the whole of the "f" variables in one line of code.. f obviously standing for female but when I use the way I have code it is showing errors?
I am sorry, i am beginner.
import java.util.*;
class university {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
Person2 mPerson, fPerson = null;`
String fFirstName, fSurname, mFirstName, mSurname;
int fAge, mAge;
System.out.println("Please enter the firstname of your favourite female author");
fFirstName = scanner.nextLine();
System.out.println("Please enter her second name");
fSurname = scanner.nextLine();
System.out.println("Please enter her age");
fAge = scanner.nextInt();
scanner.nextLine();
System.out.println("Please enter the firstname of your favourite female author");
mFirstName = scanner.nextLine();
System.out.println("Please enter her second name");
mSurname = scanner.nextLine();
System.out.println("Please enter her age");
mAge = scanner.nextInt();
fPerson = new Person2(fFirstName, fSurname, fAge);
System.out.print(fPerson);
}
}