Chapter 1 Flashcards
Objects
- Created from classes
- represent “things” from the real world or from some problem domain
- represents individual instances of the class
- ie. if class is car, objects are racecar, limousine etc
Classes
- represents all objects of a kind
- uppercase
- ie. car
Instance
- a particular object
- refer to objects as instances when we want to emphasize that they are of a particular class
- ie. the object is an instance of the class car
Objects naming convention
Lowercase
Objects have___ which can be invoked, and called what in Java?
-operations
-methods
What do methods have to pass additional info needed to execute?
parameters
Data type
specifies what kind of data can be passed to the parameter
-integer (int) specifies whole numbers
An object has attributes which are?
Values stored in fields
The class defines_________ but each object_________
-what fields an object has
-stores its own set of values (the state of the object)
State
-The set of values of all attributes defining an object
-inspect in java
Each class has a source code ___________________
-(java code) associated with it that defines its details (fields and methods)
Compilation
-java is a high level language
-but computers can only interpret low level machine code
-compilers translate programming code into machine code
What return type returns a value?
non-void return type
Signature
-The method name and the parameter types of a method
-it provides the info needed to invoke the method
ie.
void moveHorizontal (int distance)
signature = moveHorizontal(int)
Header
-provides info about the method in question
ie.
void moveHorizontal (int distance)