Skip to content

Instantly share code, notes, and snippets.

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