Java Reference
In-Depth Information
2. Writing a program to tie the classes together to make everything
functional is not feasible without implementing all the methods. For
now, just write and compile each class to match your design from
Lab 4.1.
3. Write a program named VideoStore that creates an instance of each
of your classes, initializes their fields, and invokes the methods to
practice accessing the fields and methods of objects.
4. Compile and run your VideoStore program.
You should see the output of all the methods you invoked within your
classes.
Summary
Procedural programming involves designing a program around the
tasks that the program needs to accomplish. Object-oriented program-
ming involves designing a program around the objects in the problem
domain.
■■
Object-oriented analysis and design is the process of determining the
objects in a problem domain, determining any relationships between
these objects, and also determining the attributes and behaviors of each
object.
■■
A class is a description of an object, and an object is an instance of a
class.
■■
The class keyword is used to declare a class in Java. A class consists of
fields and methods.
■■
The new keyword instantiates an object. The new operator returns a
reference to the newly created object. The object remains in memory
until it can no longer be reached by any reference, at which point the
object becomes eligible for garbage collection.
■■
The garbage collector is a low-priority thread of a JVM that is constantly
looking for unreachable objects and freeing them from memory.
■■
The dot operator is used to access the fields and methods of an object
using a reference to the object.
■■
Every object has a reference to itself referred to as the this reference.
■■
Search WWH ::




Custom Search