Skip to content

Instantly share code, notes, and snippets.

@mayararysia
Created August 21, 2020 14:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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