Hey guys! So I'm trying to make a simple program that prints out the attributes of "Person". I'm kinda still practicing with java so I'm not sure what the errors are about. Here's what I have:
Driver:
public class Driver {
public static void main(String[] args) {
Person a = new Person ("Brian Scalabrine", 22, "male", "b.scalabnrine@gmail.com");
Person b = new Person ("Anderson Silva", 34, "male", "silvadaspida@gmail.com");
}
public static void printSelf(){
System.out.println("Name: " +name);
System.out.println("Age: " +age);
System.out.println("Gender: " +gender);
System.out.println("Email: " +email);
}
}
Person
public class Person {
private String name;
private int age;
private String gender;
private String email;
public Person (String name, int age, String gender, String email){
this.name = name;
this.age = age;
this.gender = gender;
this.email = email;
}
public String getName(){
return name;
}
public void setName(String name){
this.name = name;
}
public int getAge(){
return age;
}
public void setAge(int age){
this.age = age;
}
public String getGender(){
return gender;
}
public void setGender(String gender){
this.gender = gender;
}
public String getEmail(){
return email;
}
public void setEmail(String email){
this.email = email;
}
}