Q1
Object
Answer: represents an entity in the real world that can be distinctly identified. An
object is an instance of a class. Pg. 322
Q2
Object creation
Answer: The syntax for creating an object: classname objectReferenceVariable = new
classname(arguments if any); Ex: TV tv1 = new TV(arguments if any) Pg. 328
Q3
Data fields
Answer: the state of the object (also known as its properties or attributes) is
represented by data fields with their current values java uses variables to define data
fields Ex: A circle object has a data field radius which is the property that
characterizes the circle Ex: a rectangle object has the data fields width and height
which are the properties that characterize a rectangle Pg. 323
Q4
Behavior of an object The behavior of an object (also known as its actions) is defined by
methods. To invoke a method on an object is to ask the object to perform an action Ex: you
may define methods named getArea() and getPerimeter() for circle objects. A circle object may
invoke getArea() to return its area and getPerimeter t0 to return its perimeter Pg. 323
Answer: methods named getArea() and getPerimeter() for circle objects. A circle
object may invoke getArea() to return its area and getPerimeter t0 to return its
perimeter Pg. 323 is the key concept being assessed.
Q5
No arg constructor
Answer: A class normally provides a constructor without arguments
, Q6
Default constructor
Answer: A default constructor is provided automatically only if NO CONSTRUCTORS
ARE EXPLICITLY DEFINED IN THE CLASS
Q7
Reference type
Answer: A class is essentially a programmer-defined type. A class is a reference type,
which means that a variable of the class type can reference an instance of the class.
Q8
Note on object reference variables
Answer: An object reference variable that appears to hold
Q9
Note about arrays
Answer: Arrays are treated as objects in java. Arrays are created using the new
operator. An array variable is actually a variable that contains a reference to an array
Q10
Dot operator (.)
Answer: The dot operator is used to access members of that object through its
reference variable Known as a member access
Q11
Note:
Answer: Usually you create an object and assign it to a variable, and then later you
can use the variable to reference the object. Occasionally an object does not need to
be referenced later. In this case you can create an object without explicitly assigning a
variable using the syntax:
Q12
Data fields can be of reference types
Answer: The data fields can be of reference types