Fields and methods
Lesson 2 of 84 in OOPs Interview Mastery. Free to read, no account needed.
What fields and methods are
Instance fields hold state
Default values of fields
Declaring instance methods
Methods that change fields
Lessons in Objects and Classes Basics
- Class vs object
- Fields and methods
- Constructor invocation
- Reference variable vs object
- Private fields with getters
- Public vs private vs protected
- Package-private default access
- == vs equals
- Object identity vs equality
- Equals and hashcode contract
84 lessons across 9 topics. See the full course