Final Gaddis Chap 3 part 2 Flashcards
UML diagrams are
language independent
UML diagrams use
an independent notation to show return types, access modifiers, etc
variable types are placed
after the variable name, separated by a colon
ex:
-width: double
Access modifiers are denoted as
+ for public
- for private
# for protected
method return types are placed
after the method declaration name, separated by a colon
method parameters are placed
inside parenthesis after the setMethod
UML order from top to bottom
ClassName, Attributes (Variables to be initiated), Methods (Constructor, getters, setters, calculations)
Can methods have multiple parameters?
Yes.
Parameters in methods are treated as
local variables within the method
In Java, all arguments to a method are passed…
“by value”
if the argument is a reference to an object
it is the reference that is passed to the method
if the argument is a primitive,
a copy of the value is passed to the method
instance fields and methods
fields and methods that are declared as previously shown
objects created from a class each have their own copy of
instance fields
instance methods are methods that are not declared with a special keyword…
static