Comp science - Object Oriented

0.0(0)
studied byStudied by 17 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/68

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

69 Terms

1
New cards
(int)(x+0.5)
Rounds the value of a double to the nearest whole number
2
New cards
Primitive Type
Primitive types are the basic, simple data types that are inherent to Java (int, double, char, and boolean)
3
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.
4
New cards
Abstract method
Methods added to the abstract classes, that is not defined. the word (abstract) must come before the method’s return type.
5
New cards
Access Specifier
Determines who has access to using the method when writing classes and objects.
6
New cards
Accessor Method
A method that enables user to obtain information about an object’s instance and static variables. Usually refered as getter method
7
New cards
Algorithm
An algorithm is a set of steps or rules to follow to solve a particular problem.
8
New cards
Assigning to a variable
Updating the variable values. The variable is already declared. Setter methods do this
9
New cards
Attributes of on object
Object characteristics. Also called Instance variables
10
New cards
Behavior
The actions that can be completed by an abject or a class. Also called Class Methods/ Instance methods.
11
New cards
Boolean
A Java type that can either be true or false. It is also a Primitive.
12
New cards
Break
Breaks out of a while loop and executes statements that immediately follow while loop
13
New cards
Calling Method
objectName.method() → Calling a method
14
New cards
Char
is a java type that represents a single character
15
New cards
Casting
Turning something of one type into anther type
16
New cards
Class
Classes are template through which objects are created. It is the formal blueprint for creating objects. Every program starts with a class
17
New cards
Class Hierarchy
Class hierarchy refers to the arrangement of classes and how they relate to each other.
18
New cards
Client
When someone 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.
19
New cards
Compile Time Error
An error in the actual Jaava code. The code will not compile into an excutable program.
20
New cards
Concatenation
The process of adding two string valuables together.
21
New cards
Contractor
Special method of a class that constracts a new object. Sets the initial values.
22
New cards
Declare Variable
Defining variable for the first time
23
New cards
Define Method
Defining a method means to teach the computer a new command and explain what it should do when receiving that command.
24
New cards
Double
Jave type that represents
25
New cards
Encapsulation
The process of hiding the implementation details of a class from the user
26
New cards
Exception
Thrown by java when a runtime error is encountered.
27
New cards
For Loop
Repeats code a fixed number of times
28
New cards
Getter method
An instance method that allows the client to **get** the value of an instance variable on an object.

\
29
New cards
If Statements
if (boolean expression) { //execute statements if condition is true }
30
New cards
Immutable
Unable to be changed or manipulated. String are immutable.
31
New cards
Infinite loop
Occurs when the expression in a while loop never evaluates to false. The program continues to run infinitely.
32
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.
33
New cards
Initialize a Variable
Initializing a variable is giving it an initial value, or a starting value.
34
New cards
Instance
\
\
Create an instance of a class object.

\
35
New cards
Instance Methods
An instance method is a method that defines the behavior of an object. It defines an action that the object can perform.
36
New cards
Instance Variable
Used to store the state, or data of the object instances.
37
New cards
Int
`int` is a Java type that represents an integer (a whole number)
38
New cards
Local Variable
A variable that is defined in a method or constructor. It only exist in the context of the method that it belongs to.
39
New cards
Loop-and-a-half
A loop, most often set with `while(true)`, that has a `break` statement in the loop body.
40
New cards
Method
Procedures that allow us to control and define the behavior of an object.
41
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.
42
New cards
Method Overriding
If a subclass defines a new method body for a method defined in the superclass, then the subclass has **overridden** the method of the superclass.
43
New cards
Mutator Method
A method that enables user to change the value of an object’s instance and static variables.

OR

Methods used to change or manipulate instance variable or object data. Also referred to as setter methods.

\
44
New cards
New
Necessary keyword for instantiating a new class object.
45
New cards
Object
An object is a variable of a data type that is user defined. Every object has a state and a behavior.
46
New cards
Object Oriented Programming
\
\
Programming model that focuses on **objects** and the data and actions associated with the objects.

\
47
New cards
Parameter
A variable passed into a method from outside the method.
48
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
49
New cards
Primitive Types
Primitive types are the basic, simple data types that are inherent to Java (int, double, char, and boolean)
50
New cards
Private
Restricts access to data and methods to the declaring class.
51
New cards
Public
Allows access to data and methods from classes outside the declaring class.
52
New cards
Return
Keyword used in methods to return a value back to the initial program that called the method.
53
New cards
Return Type
The `return` statement exits a method and returns a value.
54
New cards
Return Value
The value returned from a method
55
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.
56
New cards
Scope
Defines which part of the program a variable can be accessed from.
57
New cards
Sentinel
\
A constant that has the specific purpose of being the value that breaks out of a loop.

\
58
New cards
Setter method
An instance method that allows the client to **set** the value of an instance variable on an object.
59
New cards
Shadowing
If two variables within the same scope have the same name, the variable with the more specific scope will be called.
60
New cards
State
The state of an object is all of the object's associated data. It is the *state* that the object is in. The data that is associated with an object or class.
61
New cards
Static method
A method called on the Class, rather than on a specific object of the Class.
62
New cards
Static Variable
A variable or attribute of a class that is shared between **all** instance of a class. Each instance **does not** get their own copy.
63
New cards
String
String is a Java type that represents a string of characters (text)
64
New cards
Subclass
A child class that inherits attributes and behaviors from a superclass (parent).
65
New cards
Super
The `super` keyword lets us reference the superclass when writing code inside of a subclass.
66
New cards
Superclass
\
\
A parent class that contains common attributes and behaviors used by subclasses (children).

\
67
New cards
this
The `this` keyword is a reference to the current object (the current instance).
68
New cards
toString
A specific accessor method that returns a String value with information about an object’s instance values. This overrides the object’s inherit toString method when an object is printed using System.out.print or System.out.println
69
New cards
Variable
A symbol or container that holds a value.