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
- How do member methods differ from static methods?ComputerScienceOne · Accessor & Mutator Methods
- What does the completed Java Student class example contain?ComputerScienceOne · Example
- How do you use methods defined in another Java class?ComputerScienceOne · Using Methods
- How do accessor and mutator methods use this to access instance variables?ComputerScienceOne · Accessor & Mutator Methods
- What is a constructor and how is it written?ComputerScienceOne · Constructors
- How does Java handle default and multiple constructors?ComputerScienceOne · Constructors
- How can the toString() method represent a Java object?ComputerScienceOne · Common Methods