Skip to content

Instantly share code, notes, and snippets.

@mayararysia
Last active August 20, 2020 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayararysia/137ace407ea71a9a940c60a55b654f33 to your computer and use it in GitHub Desktop.
Save mayararysia/137ace407ea71a9a940c60a55b654f33 to your computer and use it in GitHub Desktop.
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