Following the book Data Structures with Java by John R. Hubbard, Ph.D.
An object is a software unit that is produced according to a unique class specification. It is called an instance of its class. The process of creating it is called instantiating the class.
A java class consists of three kinds of members
- Fields
- Methods
- Constructors
The fields hold the data for class objects The methods hold the statements that are executed by the object The constructor holds the code that initializes the object's fields
Specifying what an object can do, without specifying how it does it is an abstraction.
Concealing the implementation of a method from the clients who use the method is called information hiding.
An Abstract Data Type is a specification of only the behaviour of instances of that type.
Classes are concrete data types that specify how their state is stored, and how their instances behave.
A class may have six kinds of members
1. Fields that specify the kind of data that the object holds
2. Constructors that specify how the objects are to be created
3. Methods that specify the operations that the object can perform
4. Nested classes
5. Interfaces
6. Enum type definition
The purpose of a declaration is to introduce an identifier to the compiler. It provides all the information the compiler needs in order to compile statements that uses that identifier.
A field is a variable that holds data for the object.