public class WhoAmI{
private String name;
private String job;
private String[] hobbies;
private String location;
public WhoAmI(String name, String job, String[] hobbies, String location){
this.name = name;
this.job = job;
this.hobbies = hobbies;
this.location = location;
}
public String getName() {
return name;
}
public String getJob() {
return job;
}
public String[] getHobbies() {
return hobbies;
}
@Override
public String toString() {
return("Hi my name is "+ this.getName()+ ", from" + this.getLocation() +
"! My Job is "+ this.getJob()+" and my hobbies are " + this.getHobbies();
}
public static void main(String[] args) {
whoAmI vinesh = new WhoAmI(
"Vinesh Ghela",
"QA Developer",
["Reading", "Trying new food","Gym" ,"Chasing Semi-colons"],
"London, United Kingdom");
System.out.println(vinesh);
}
}
Popular repositories Loading
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.