Java Class Terminology Flashcards Preview

Java 1 > Java Class Terminology > Flashcards

Flashcards in Java Class Terminology Deck (26)
Loading flashcards...
1

Constructor?

Allows a program/driver to create objects from the class (instantiate an object). Parameters() are optional.

2

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).

3

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.

4

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); }

5

toString?

written within the class so that a driver can display a certain format pre determined. routinely displays data.

6

UML?

UML = Unified Modeling Language represents a specific class in visual manner. *We never add instance variables that are not in the UML diagram.

7

instantiate?

instantiate: when an object is created. Done within a class. the object inherits generic values from the class it is created in.

8

what are data members called?

data members: same as instantiated variables / fields.

9

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).

10

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

11

what is a method modifier?

method modifier: The access type of either public or private

12

what is a method return type?

method return type: the data type returned= char, int, double, float.

13

what is a method name?

method name: name i choose for the method to be called on later.

14

what is a method signature?

method signature: method name and parameter list combined

15

what is a method parameter?

method parameter: a placeholder.. when a method is invoked(used) a value is passed called the argument.

16

what is it called when a program or driver contains the main() method?

application -uses classes within their programs.

17

is input generated from: drivers, classes or applications

applications only.

18

user defined class?

class that is not part of the java library. was built by a programmer and does not contain input or output.

19

instance data?

non static data that can change values. usually declared at the top of a class.

20

local data items?

data items declared within class methods such as within a constructor, mutator or accessor.

21

describe what overriding is?

when an already defined method is overwritten with data that is custom or slightly different. **often used with toString() to produce custom output.

22

equals method used?

determines if two objects from the same class are the same. is a boolean of true or false and can be defined within a class.

23

how new objects are instantiated inside a driver?

the class name is used before the instantiated object name (new object) so that the constructor within the class can form the instantiated object the correct way. data is entered inside ().

24

what is the format of a mutator?

ObjectName.MutatorMethod (Arguments needed) example: customerName = in.nextLine(); System.out.print("enter in the name") ObjectJulie.setName (customerName);

25

what is a shortcut in code for the driver that will use the toString method with an object?

System.out.print(object); ^ is the same as System.out.print(object.toString());

26

Describe how a Method is set up.
visialize the different parts. How is it "built"?