Skip to content

Instantly share code, notes, and snippets.

@mayararysia
Created August 21, 2020 14:58
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/2a56fb70ea9deab92a3937be531ba9fb to your computer and use it in GitHub Desktop.
Save mayararysia/2a56fb70ea9deab92a3937be531ba9fb to your computer and use it in GitHub Desktop.
An example of a class Main - Person
class Main {
public static void main(String[] args) {
// person1 object is of type Person
Person person1 = new Person();
person1.setName("Teddy");
person1.walk(); // person1 walks
// person2 object is of type Person
Person person2 = new Person();
person2.talk(); // person2 talks
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment