Test 1 Flashcards
(43 cards)
Accesor Method
gets a value from a specified location
OS
operating system
Mutator Method
sets a value for a given variable
Constructor
a method type that creates a new object
Default constructor
called when there is no constructor written, sets all the object’s fields to 0 and all booleans to false
Copy Constructor
calls a constructor to set the values of the new object to those of another object. Shallow only copies the data’s location, while deep copies the data itself
Instance field
Data which an instance method uses and acts upon
Class
contains a program
Object
a set of data which is acted upon
this
reference variable used by an object to refer to itself
Static Method
a program that you put values into and get another value out of
De Morgan’s Law
!((x >= -3) && (x > 5)) == (x < -3) || (x >= -5)
Boolean operators
|| && if else if-else
Relational operators
> , =, <>
Data Primitive
int, double, float, short, long, boolean
Key Word
a word or phrase which has a dedicated meaning or process assigned to it
Type Cast
forces a data type to convert, such as float to int
Assignment operator
assigns a value to a variable
Truncation
removes part of a number or lessens the accuracy of a number. Usually occurs when float to int removes numbers left of the decimal
Round-off
rounding a number?
Concatenation of Strings
adding two strings together
Overloading
using the same constructor for many objects
Null reference
when no values are assigned to a new variable, it is assigned a null
Method header line components
(public, private, etc)(if static, static)(return type) (argument)