Computer Science

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

1/61

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

62 Terms

1
New cards

(int)(x + 0.5)

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 user to obtain information about an object’s instance and static variables. Also referred to as getter methods.

5
New cards

Assigning to a variable

To update the variable's value.

6
New cards

Attributes of an object

An object’s characteristics (Instance Variables).

7
New cards

Behaviors (Class Methods)

The behavior of an object is what the object is able to do. It is the actions that can be performed by the object.

8
New cards

Boolean

A Java primitive type that can either be true or false

9
New cards

Break

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

10
New cards

Calling a Method

objectName.method() - Calling a method actually gives the command, so the computer will run the code for that method.

11
New cards

Casting

Turning something of one type into another type.

12
New cards

Char

A Java type that represents a single character (a single letter)

13
New cards

Class

A class is a template, or a blueprint, from which Java objects are created. All Java programs start with a class.

14
New cards

Class Hierarchy

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

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

16
New cards

Compile Time 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.

17
New cards

Concatenation

The process of adding two String values together. This creates a new String object. Primitives can be concatenated with String objects.

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

19
New cards

Declare a variable

Declaring a variable is defining it for the first time.

20
New cards

Defining a Method

To teach the computer a new command and explain what it should do when receiving that command.

21
New cards

Double

A Java type that represents a real number with decimal values

22
New cards

Encapsulation

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

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

24
New cards

For Loop

A for loop lets us repeat code a fixed number of times.

25
New cards

Getter Method

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

26
New cards

If Statement

Executes code only if condition is true

27
New cards

Immutable

Unable to be changed or manipulated. String are immutable.

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

29
New cards

Initializing a Variable

Initializing a variable is giving it an initial value.

30
New cards

Instance

A created object with defined attributes.

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 Variable

A variable defined in a Class, for which each object of the class has its own copy.

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

34
New cards

Loop and a half

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

35
New cards

Method

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

36
New cards

Method Overloading

Methods can have multiple signatures. Java will use the correct signature based on the actual parameters used in a program.

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

38
New cards

Mutator Method

A method that enables user to change the value of an object’s instance and static variables.

39
New cards

New

Necessary keyword for instantiating a new class object.

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

Object Oriented Programming

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

42
New cards

Parameter

A variable passed into a method from outside the method.

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

44
New cards

Primitive Type

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

45
New cards

Public

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

46
New cards

Return

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

47
New cards

Return Type

Indicates what type value is being returned from the method

48
New cards

Return Value

The value that is returned from a method.

49
New cards

Scope

In what part of the program the variable exits

50
New cards

Sentinal

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

51
New cards

Setter Method

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

52
New cards

Shadowing

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

53
New cards

State

The data that is associated with an object or class.

54
New cards

Static Method

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

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

56
New cards

String

A sequence of characters

57
New cards

Subclass

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

58
New cards

Super

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

59
New cards

Superclass

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

60
New cards

this

Refers to the current object

61
New cards

toString

toString is a special method you write in your class that returns a String representation of the object.

62
New cards

Variable

A symbol or container that holds a value.