Using Members in Classes
An Introduction with Examples in Java |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
new
operator).
operator with the object identifier as the right-side operand).
operator with the class identifier as
the right-side operand).
operator requires an object or class
identifier as the left-side operandthis
(which is a reference to
the owning object)
Why are some attributes static and some not?
What are the formal parameters of the constructor?
What local variables are used in the constructor?
What methods are invoked in the constructor and are they static or not?
How do you refer to the owning object?
Why isn't it necessary to do so?
Could you do so anyway?
Which new methods are private
?
What is true of private
members?
Why include private
methods?
Is it necessary to use this.
when invoking
private
methods?
Which members are static and which are not?
How many objects are being compared?
How are they referred to?
Is it necessary to use this.
?
Why are the attributes of other
accessible?
String
Representation
When might this method be useful?
What operators are being used?
main()
method of the main class
self
(though needn't be) and is the first
parameter passed to a method