Unit 2 - Class Structure and Design

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/42

encourage image

There's no tags or description

Looks like no tags are added yet.

43 Terms

1
New cards

assignment

using the assignment operator ( = ) to initialize or change the value stored in a variable

2
New cards

data type

the format of the data that can be stored in a variable

3
New cards

declaration

giving a name and data type to a variable

4
New cards

initialization

giving a starting value to a variable using the assignment operator ( = )

5
New cards

literal

a source code representation of a value, such as a number or text

6
New cards

primitive type

a basic data type that Java predefines

7
New cards

reference type

a data type that contains a pointer to the memory location of an object

8
New cards

variable

a container that stores a value in memory

9
New cards

ArithmeticException

an error caused by dividing by zero

10
New cards

compound assignment operator

shortcut syntax ( += , -= , *= , /= , %= ) to perform an operation (+ , - , * , / , or % ) on both operands and store the result into the variable on the left

11
New cards

compound expression

a combination of expressions

12
New cards

expression

a combination of data and operators that evaluates to a single value

13
New cards

operand

the data that is operated on

14
New cards

truncate

to cut off data from the end

15
New cards

access modifier

a keyword used to set the visibility of classes, variables, constructors, and methods

16
New cards

encapsulation

an object-oriented programming concept where the instance variables of a class are hidden from other classes and can be accessed only through the methods of the class

17
New cards

instance variable

a variable defined in a class that represents an attribute of an object

18
New cards

actual parameter

the value given to an attribute when initializing an object

19
New cards

call by value

copying the value of the actual parameter to the constructor's formal parameter

20
New cards

default value

a predefined value that is used by a program when the user does not provide a value

21
New cards

formal parameter

the values to be passed to a constructor or method

22
New cards

local variable

a variable declared and accessible within a specific block of code

23
New cards

no

argument constructor - a constructor with no parameters

24
New cards

overloading

defining two or more constructors or methods with the same name but different signatures

25
New cards

parameterized constructor

a constructor that has a specific number of arguments to be passed to assign values to an object's instance variables

26
New cards

NullPointerException

an error that occurs when a reference does not point to an object

27
New cards

null

indicates that the variable does not refer to any object

28
New cards

application program interface (API)

a library of prewritten classes

29
New cards

library

a collection of methods or reusable components of code

30
New cards

DRY principle

a software development principle that stands for "Don't Repeat Yourself" which aims to reduce repetition in code

31
New cards

refactor

to improve the readability, reusability, or structure of program code without altering its functionality

32
New cards

return keyword

exits a method and provides the value to where the method is called

33
New cards

accessor method

gives the value stored in an instance variable

34
New cards

return by value

a copy of the value is given to where the method is called

35
New cards

return type

the type of the value to be given from the method

36
New cards

Boolean expression

a logical statement that gives either a true or false value

37
New cards

Sentinel Value

a special value used to notify the program to stop accepting input

38
New cards

mutator method

changes the value stored in an instance variable

39
New cards

relational operator

an operator used to compare values or expressions

40
New cards

escape sequence

starts with a \ to indicate how to display a String

41
New cards

override

to define a method in a subclass with the same method signature as a method inherited from a superclass

42
New cards

this keyword

a keyword used to refer to the current object in a method or constructor

43
New cards

scope

where a variable can be used