Rounds the value of a double to the nearest whole number.
2
New cards
### Abstract Class
A class, usually at the top of a Class Hierarchy, that cannot be instantiated, because not all of its methods are defined
3
New cards
### Abstract method
A method, written in an Abstract Class, that is not defined. The word abstract must come right before the method's return type. It is up to the subclass to fill in the definition for the abstract method.
4
New cards
### Accessor Method
A method that enables the user to obtain information about an object’s instance and static variables. Also referred to as getter methods
5
New cards
### Getter Method
An instance method that allows the client to **get** the value of an instance variable on an object
6
New cards
### Assigning to a variable (setter methods)
Assigning to a variable is updating the variable's value
7
New cards
### attributes of an object (instance variables)
An object’s characteristics.
8
New cards
### Behavior (methods)
The actions that can be completed by an object or class.The behavior of an object is what the object is able to do. It is the actions that can be performed by the object.
9
New cards
### Boolean
boolean is a Java type that can either be true or false. It is primitive.Â
10
New cards
### break
Breaks out of a while loop and executes statements that immediately follow while loop.
11
New cards
### Calling a method
Calling a method actually gives the command, so the computer will run the code for that method. objectName.method()
\
12
New cards
Casting
Casting is turning something of one type into another typeÂ
13
New cards
### Compile Time Error (syntax error)
An error in the actual Java code. The code will not **compile** into an executable program, because there are errors in the text of the code.
14
New cards
### Client
When someone else creates a Class (like String, or Randomizer), and you are using the functionality of that Class in your program, your program is a *client* of the class. You are using the class as a client.
15
New cards
### Class Hierarchy
Class hierarchy refers to the arrangement of classes and how they relate to each other
16
New cards
### Class
A class is a template, or a blueprint, from which Java objects are created. All Java programs start with a class.
17
New cards
### char
char is a Java type that represents a single character (a single letter). It is a primitiveÂ
18
New cards
### Define a method
Defining a method means to teach the computer a new command and explain what it should do when receiving that command.
19
New cards
Declare a Variable
Declaring a variable is defining it for the first time.
20
New cards
Constructor
A constructor is a special method of a Class that constructs a new object (a new instance) of the Class and sets the initial values for the instance variables.
21
New cards
### Concatenation
The process of adding two String values together. This creates a new String object. Primitives can be concatenated with String objects.
22
New cards
double
double is a Java type that represents a real number with decimal values. It is primitive.Â
23
New cards
### Encapsulation
The process of hiding the implementation details of a class from the user.
24
New cards
### Exception
An exception is thrown by Java when a **runtime error** is encountered. The exception provides information about what kind of error occurred.
25
New cards
### For Loop
###
A for loop lets us repeat code a **fixed number of times**.
26
New cards
### Immutable
Unable to be changed or manipulated. String are immutable.
27
New cards
\ ### Inheritance
When a subclass extends a superclass, the subclass inherits all of the static methods, static variables, and public instance methods of the superclass. This is called inheritance.
28
New cards
### Instance Variable
A variable defined in a Class, for which each object of the class has its own copy
29
New cards
### int
int is a Java type that represents an integer (a whole number)
30
New cards
### Local Variable
A variable that is defined in a method or constructor. It only exists in the context of the method that it belongs to
31
New cards
### Instance Method
An instance method is a method that defines the behavior of an object. It defines an action that the object can perform.
32
New cards
### Instance
Instance is what you call a specific object constructed from a class. Instance and object generally refer to the same thing. An object is a specific instance of a class
33
New cards
### new
Necessary keyword for instantiating a new class object.
34
New cards
### Loop-and-a-half
A loop, most often set with while(true), that has a break statement in the loop body
35
New cards
### Method
### A method is a way to teach the computer a new command
36
New cards
### Method Overloading
###
Classes can have multiple methods with the same name, as long as the parameters to those methods are different. Doing this is called "overloading" a method. Methods can have multiple signatures. Java will use the correct signature based on the actual parameters used in a program.
37
New cards
### Method overloading
Methods can have multiple signatures. Java will use the correct signature based on the actual parameters used in a program. Classes can have multiple methods with the same name, as long as the parameters to those methods are different. Doing this is called "overloading" a method.
38
New cards
\ ### Mutator Methods
Methods used to change or manipulate instance variable or object data. Also referred to as setter methods.
39
New cards
### Object Oriented Programming
The use of object and class types in programming.
Programming model that focuses on **objects** and the data and actions associated with the objects.
40
New cards
### Object
An object is a variable of a data type that is user defined. Every object has a state and a behavior.
41
New cards
Private
Restricts access to data and methods to the declaring class.
42
New cards
### Primitive Type
Primitive types are the basic, simple data types that are inherent to Java (int, double, char, and boolean)
43
New cards
### Polymorphism
An object can take on different forms depending on its implementation. Java can call the correct method even when an object is disguised as a more generic reference type. Polymorphism is the capability of a method to do different things depending on which object it is acting upon.
44
New cards
### Parameters
Pieces of information you can give to functions when you define them. When the function is called the arguments are the data you pass into the function's parameters. Parameter is the variable in the declaration of the function. Argument is the actual value of this variable that gets passed to the function.
45
New cards
### Return value
The value returned from a method.
46
New cards
### Return type
A method's return type is the type of value returned from that method.
47
New cards
### return
Keyword used in methods to return a value back to the initial program that called the method.
48
New cards
### public
Allows access to data and methods from classes outside the declaring class.
49
New cards
### Runtime Error
An error that happens while the program is running. Even if the code is written with the proper syntax, there are things that can go wrong while the program is running.
50
New cards
### Scope
Defines which part of the program a variable can be accessed from.
51
New cards
Sentinel
A constant that has the specific purpose of being the value that breaks out of a loop.
52
New cards
Setter method
An instance method that allows the client to **set** the value of an instance variable on an object.
53
New cards
Static method
A method called on the Class, rather than on a specific object of the Class.Static methods are the methods in Java that can be called without creating an object of class. Static methods are called using the dot operator along with the class name unless they are defined in the enclosing class.
54
New cards
Shadowing
If two variables within the same scope have the same name, the variable with the more specific scope will be called.
55
New cards
### State(instance variable)
The data that is associated with an object or class