JAVA DEFINITIONS

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

1/38

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:12 PM on 2/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

39 Terms

1
New cards

Dynamic Typing

Language infers ‘types’ at runtime (python)

2
New cards

Static Typing

Languages check ‘types’ before code is run

3
New cards

Void

Nothing is returned but code will run like usual (the method name main is the return type of this method)

4
New cards

Compilation

Intermediary “code translation” step that happens before code runs

  • during this step the compiler check types (and other things) and performs optimizations on your code

5
New cards

Primitive Types (8 in Java)

int, double, char, boolean

6
New cards

Expressions

A unit of code with a type/ value

  • literals: int, double, boolean, char

  • variables: int age = 27

  • using operator: 27 * 12

  • method calls: static int daysToMinutes(int days)

7
New cards

Statement

A unit of code that describes an action executed for its side effect.

  • assignment statements: int x = 7; // stores RHS value into LHS container

8
New cards

Primitive type coercion

Primitive types can be coerced (modified) either through implicit widening or explicit casting.

  • implicit (widening): 3 + 4.0 → 3.0 + 4.0 → 7.0

  • explicit (casting): 7/2 → 3 (truncated division)

  • (double) 7/2 → 3.5

  • (double)(7/2) → 3

9
New cards

Runtime Stack

When a method is called in Java, space is allocated for its parameters and local variables in a region called the…

10
New cards

Call Frame

Created when a method is called and deleted when that method returns.

11
New cards

Variable declaration

int hours;

12
New cards

Variable definition

hours = 24 * days;

13
New cards

Variable initialization

int minutes = 60 * hours;

14
New cards

Static

used to declare a “free function” (is not tied to a particular instance of a class)

15
New cards

Classes

The basic building blocks of Java programs are…

16
New cards

Methods

code subroutines

17
New cards

Type

The (static) type of a variable characterizes the set of possible values (or states) that it can be assigned, and the ways that it can be used within the program.

18
New cards

Local Variables

Stored in call frames on the runtime stack.

19
New cards

Object

an instance of a non-primitive type.

20
New cards

Reference Types

Non-primitive types in Java

  • All types beyond the 8 primitive types in Java are reference types

  • Instances of reference types are called objects.

  • A reference type is defined by a class

21
New cards

Heap

Where objects of reference types are allocated

22
New cards

Instance Methods

operations defined within a class that can be called on an object of that class.

  • The behaviors of reference types are primarily specified by defining instance methods within their classes

23
New cards

Null

indicates the absence of an object reference; a reference type variable that is null does not have an arrow pointing to any object on the heap.

24
New cards

String Literal

the sequence of characters of the String we are creating, writing

25
New cards

Array

a data structure with a fixed capacity that stores elements of a particular type in an ordered, linear arrangement of cells.

26
New cards

Index

a number used to identify a specific cell in an array.

27
New cards

Specification

The specifications of a unit of code (for example, a method, a class, or a field) are a description of the intended behavior of that code.

28
New cards

Implementer

An implementer(s) of a unit of code (a method or a class) is a developer who provides the definition of that code

29
New cards

Client

a developer who calls that code from within code that they are writing.

30
New cards

Pre-Condition

a property that must be true when a method is called.

  • Most often, these are requirements on the values of input parameters or the states of objects that they reference.

31
New cards

Post-Condition

a property that will be true when the method returns.

  • These include properties of the method's return value as well as any side effects of the method.

32
New cards

Defensive Programming

the implementer actively turns pre-condition violations into runtime errors using assert statements.

33
New cards

Unit Testing

a small unit of code (e.g., a single method or class) is tested in isolation.

  • Checks are performed against this unit of code to ensure that it conforms to its specifications.

34
New cards

Test-Driven Development

use specifications to develop unit tests for a piece of code that is not yet written and use these unit tests to guide the method's development.

35
New cards

Glass Box Testing

some implementation details are used to inform the design of unit tests, particularly to ensure good test coverage.

36
New cards

Black Box Testing

tests are written using specifications of a method and not based on any internal implementation details of the methods/classes.

37
New cards

Time Complexity

the number of basic operations that its code performs, expressed as a function in terms of various parameters of its input size.

38
New cards

Space Complexity

the maximum amount of memory that is allocated at one time during the execution of the method beyond the space of its input parameters.

39
New cards