Skip to content

Instantly share code, notes, and snippets.

@mayararysia
Last active Aug 20, 2020
Embed
What would you like to do?
An example of a class Person
public class Person {
//attributes
private String name;
private Date dateBirth;
//methods
public void walk(){ ... }
public void talk(){ ... }
public eat(){ ... }
@Override
public String toString() {
return "Name: "+ this.name
+ "\nDate of Birthday: "+ this.dateBirth.toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment