Last active
August 20, 2020 21:26
-
-
Save mayararysia/137ace407ea71a9a940c60a55b654f33 to your computer and use it in GitHub Desktop.
An example of a class Person
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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