Comp science - Object Oriented

studied byStudied by 17 people
0.0(0)
Get a hint
Hint

(int)(x+0.5)

1 / 68

69 Terms

1

(int)(x+0.5)

Rounds the value of a double to the nearest whole number

New cards
2

Primitive Type

Primitive types are the basic, simple data types that are inherent to Java (int, double, char, and boolean)

New cards
3

Abstract Class

A class, usually at the top of a Class Hierarchy, that cannot be instantiated, because not all of its methods are defined.

New cards
4

Abstract method

Methods added to the abstract classes, that is not defined. the word (abstract) must come before the method’s return type.

New cards
5

Access Specifier

Determines who has access to using the method when writing classes and objects.

New cards
6

Accessor Method

A method that enables user to obtain information about an object’s instance and static variables. Usually refered as getter method

New cards
7

Algorithm

An algorithm is a set of steps or rules to follow to solve a particular problem.

New cards
8

Assigning to a variable

Updating the variable values. The variable is already declared. Setter methods do this

New cards
9

Attributes of on object

Object characteristics. Also called Instance variables

New cards
10

Behavior

The actions that can be completed by an abject or a class. Also called Class Methods/ Instance methods.

New cards
11

Boolean

A Java type that can either be true or false. It is also a Primitive.

New cards
12

Break

Breaks out of a while loop and executes statements that immediately follow while loop

New cards
13

Calling Method

objectName.method() → Calling a method

New cards
14

Char

is a java type that represents a single character

New cards
15

Casting

Turning something of one type into anther type

New cards
16

Class

Classes are template through which objects are created. It is the formal blueprint for creating objects. Every program starts with a class

New cards
17

Class Hierarchy

Class hierarchy refers to the arrangement of classes and how they relate to each other.

New cards
18

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.

New cards
19

Compile Time Error

An error in the actual Jaava code. The code will not compile into an excutable program.

New cards
20

Concatenation

The process of adding two string valuables together.

New cards
21

Contractor

Special method of a class that constracts a new object. Sets the initial values.

New cards
22

Declare Variable

Defining variable for the first time

New cards
23

Define Method

Defining a method means to teach the computer a new command and explain what it should do when receiving that command.

New cards
24

Double

Jave type that represents

New cards
25

Encapsulation

The process of hiding the implementation details of a class from the user

New cards
26

Exception

Thrown by java when a runtime error is encountered.

New cards
27

For Loop

Repeats code a fixed number of times

New cards
28

Getter method

An instance method that allows the client to get the value of an instance variable on an object.

New cards
29

If Statements

if (boolean expression) { //execute statements if condition is true }

New cards
30

Immutable

Unable to be changed or manipulated. String are immutable.

New cards
31

Infinite loop

Occurs when the expression in a while loop never evaluates to false. The program continues to run infinitely.

New cards
32

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.

New cards
33

Initialize a Variable

Initializing a variable is giving it an initial value, or a starting value.

New cards
34

Instance

Create an instance of a class object.

New cards
35

Instance Methods

An instance method is a method that defines the behavior of an object. It defines an action that the object can perform.

New cards
36

Instance Variable

Used to store the state, or data of the object instances.

New cards
37

Int

int is a Java type that represents an integer (a whole number)

New cards
38

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.

New cards
39

Loop-and-a-half

A loop, most often set with while(true), that has a break statement in the loop body.

New cards
40

Method

Procedures that allow us to control and define the behavior of an object.

New cards
41

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.

New cards
42

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.

New cards
43

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.

New cards
44

New

Necessary keyword for instantiating a new class object.

New cards
45

Object

An object is a variable of a data type that is user defined. Every object has a state and a behavior.

New cards
46

Object Oriented Programming

Programming model that focuses on objects and the data and actions associated with the objects.

New cards
47

Parameter

A variable passed into a method from outside the method.

New cards
48

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

New cards
49

Primitive Types

Primitive types are the basic, simple data types that are inherent to Java (int, double, char, and boolean)

New cards
50

Private

Restricts access to data and methods to the declaring class.

New cards
51

Public

Allows access to data and methods from classes outside the declaring class.

New cards
52

Return

Keyword used in methods to return a value back to the initial program that called the method.

New cards
53

Return Type

The return statement exits a method and returns a value.

New cards
54

Return Value

The value returned from a method

New cards
55

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.

New cards
56

Scope

Defines which part of the program a variable can be accessed from.

New cards
57

Sentinel

A constant that has the specific purpose of being the value that breaks out of a loop.

New cards
58

Setter method

An instance method that allows the client to set the value of an instance variable on an object.

New cards
59

Shadowing

If two variables within the same scope have the same name, the variable with the more specific scope will be called.

New cards
60

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.

New cards
61

Static method

A method called on the Class, rather than on a specific object of the Class.

New cards
62

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.

New cards
63

String

String is a Java type that represents a string of characters (text)

New cards
64

Subclass

A child class that inherits attributes and behaviors from a superclass (parent).

New cards
65

Super

The super keyword lets us reference the superclass when writing code inside of a subclass.

New cards
66

Superclass

A parent class that contains common attributes and behaviors used by subclasses (children).

New cards
67

this

The this keyword is a reference to the current object (the current instance).

New cards
68

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

New cards
69

Variable

A symbol or container that holds a value.

New cards

Explore top notes

note Note
studied byStudied by 12 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 66 people
Updated ... ago
4.2 Stars(5)
note Note
studied byStudied by 15 people
Updated ... ago
4.0 Stars(1)
note Note
studied byStudied by 19 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 44 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 11 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 66 people
Updated ... ago
4.8 Stars(4)
note Note
studied byStudied by 260 people
Updated ... ago
4.5 Stars(4)

Explore top flashcards

flashcards Flashcard24 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard44 terms
studied byStudied by 3 people
Updated ... ago
4.0 Stars(1)
flashcards Flashcard59 terms
studied byStudied by 14 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard28 terms
studied byStudied by 4 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard46 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard39 terms
studied byStudied by 21 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard32 terms
studied byStudied by 4 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard23 terms
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)