Concept
How do you use Java instances and invoke their methods?
"Once instances have been instantiated, they can be used by invoking their methods via the dot operator. The dot operator is used to select a member variable (if public) or member method.\n\n1 System.out.println(s.getFormattedName());\n\n2\n\n3 if(s.getGpa() < t.getGpa()) {\n\n4 System.out.println(t.getFirstName() + \" has a better GPA\");\n\n5 }"
Related Ideas
- How are Java class instances created and used?ComputerScienceOne · Common Methods
- What does the completed Java Student class example contain?ComputerScienceOne · Example
- What is covered in section 10.2?ComputerScienceOne · Using Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- How do you use methods defined in another Java class?ComputerScienceOne · Using Methods
- How can the toString() method represent a Java object?ComputerScienceOne · Common Methods