Java Class Terminology Flashcards
learn the 5 parts of a class. constructor, mutator, accessor, helping methods, toString
Constructor?
Allows a program/driver to create objects from the class (instantiate an object). Parameters() are optional.
Accessor? also know as a?
allows a driver/application to see the value of a private data members (variables) that is inside the class. known as: a getter (accessor).
Mutator? also known as?
allows a driver/application to alter the data value of a private variable that is within the class. also known as: a setter.
helping method? example?
Can be used within just the class by using a private access modifier we can also have a helping method that is used by the driver so that the results of private objects can be returned. example: public float calcTotal() { return (privateVariable + 2ndPrivateVariable); }
toString?
written within the class so that a driver can display a certain format pre determined. routinely displays data.
UML?
UML = Unified Modeling Language represents a specific class in visual manner. *We never add instance variables that are not in the UML diagram.
instantiate?
instantiate: when an object is created. Done within a class. the object inherits generic values from the class it is created in.
what are data members called?
data members: same as instantiated variables / fields.
what is a Method?
Method: Created within a class. set of instructions that makes an operation occur. (a formula that is contained within a word or object name).
what are the 5 parts that make up a method?
parts of method: 1- modifier 2- return type 3- method name 4- method signature 5- parameter
what is a method modifier?
method modifier: The access type of either public or private
what is a method return type?
method return type: the data type returned= char, int, double, float.
what is a method name?
method name: name i choose for the method to be called on later.
what is a method signature?
method signature: method name and parameter list combined
what is a method parameter?
method parameter: a placeholder.. when a method is invoked(used) a value is passed called the argument.