Methods & classes Flashcards
What do you call an entity in your program that you can change/manipulate?
Object
What other term can you call an Object?
Method
System.out
Object
How can you manipulate the System.out object?
Using println method
Is println a method?
yes
What else do we think of an object as?
a black box
Does an object have a public interface?
yes
What is a public interface
methods that you call
What does an implementation do?
Uses code and data to make methods work
Different or similar: System.out and “Hello, World!” Why?
different, because they are different classes
What class supports a number of methods?
String class
How do you construct any object?
- use the NEW operator
- give the name of the CLASS
- supply construction PARAMETERS with parenthesis
variable
item of information in memory
cerealBox
variable
How do you initialize the variable Rectangle cerealBox;?
Use the new operator which will create an object and return its location
What is an object location called?
object reference