ARRAY LESSON 3

Optional
can be the keywords____/_______, and _______
means that our class is accessible to other classes outside the package.
This is the keyword used to create a class in Java.
Optional, can be public, private, protected, final, static
Can be a class name or a primitive data type
Any valid identifier
Optional initial value
Allocated once(1) regardless of how many objects are created
To declare an attributes to be static, use ________
Can carry a number of different modifiers
An be any type (including void)
List of parameters separated by commas.
TWO TYPES OF METHODS
Used to exit from the current method
Used to read values from our attributes (instance/static
Returns the value of an attribute using return keyword
Usually written as: getNameOfAttribute()
Used to write or change values of attributes
Written as: setNameOfInstanceVariable(newValue)
Always returns void
DECLARING CLASSES
DECLARING ATTRIBUTES
INSTANCE VARIABLES
Static Variables
Declaring Methods
Implementation of an accessor method:
Implementation of a Mutator Method:
Static Methods
The .this reference
Allows a method with the same name but different parameters, to have different implementations and return values of different types.
{"name":"ARRAY LESSON 3", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Optional, can be the keywords____\/_______, and _______, means that our class is accessible to other classes outside the package.","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Make your own Survey
- it's free to start.