CS 1331 Lecture Vocabulary: Java Basics & Object-Oriented Programming

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

1/62

flashcard set

Earn XP

Description and Tags

A vocabulary set covering fundamental Java and OOP concepts from the lecture notes.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

63 Terms

1
New cards

Java

A high-level, object-oriented language released in 1996 by Sun Microsystems (now Oracle) designed for portability and automatic memory management.

2
New cards

JVM (Java Virtual Machine)

The interpreter that runs Java bytecode by translating it to machine code at runtime, enabling platform independence.

3
New cards

Bytecode

Platform-independent intermediate code (.class) produced by the Java compiler and executed by the JVM.

4
New cards

Compiler

Translates code from one language to another (e.g., Java source to bytecode); typically produces faster, pre-translated output.

5
New cards

Interpreter

Translates and runs code as it executes, often translating on the fly (e.g., Python).

6
New cards

javac

Java compiler command that compiles .java files into .class bytecode files.

7
New cards

public class

A class declaration that is accessible from other classes; usually in its own file named after the class.

8
New cards

public static void main(String[] args)

The program entry point; static so it can be run without an object; returns void and receives command line arguments.

9
New cards

System.out.println

Prints a line of text to the console, followed by a newline.

10
New cards

CamelCase

Naming convention with no spaces and each new word capitalized (e.g., HelloWorld).

11
New cards

.class

File extension for Java bytecode generated by the compiler.

12
New cards

.java

Source file extension; the public class name should match the file name.

13
New cards

class

Blueprint for creating objects; defines fields (state) and methods (behavior).

14
New cards

object

An instance of a class containing its own state and the operations that can be performed on it.

15
New cards

method

A function contained in a class that defines an operation its objects can perform.

16
New cards

field/variable

A member of a class that holds data (the object's state).

17
New cards

static

Modifier indicating a member belongs to the class rather than to any particular object.

18
New cards

final

Modifier to declare constants or prevent overriding, depending on context.

19
New cards

private

Access modifier restricting visibility to the declaring class.

20
New cards

public (modifier)

Access modifier that allows visibility from other classes.

21
New cards

scope

Region of a program where an identifier can be used; determined by braces and blocks.

22
New cards

primitive types

Built-in simple types: byte, short, int, long, float, double, char, boolean.

23
New cards

reference types

Types that refer to objects (e.g., String, arrays, classes); stored as object references.

24
New cards

1-D array

Fixed-size, indexable collection of elements of the same type; indices start at 0.

25
New cards

2-D array

Array of arrays (a matrix); can be rectangular or ragged.

26
New cards

String

Immutable class representing a sequence of characters.

27
New cards

String concatenation

Joining strings using + or the concat method to form a new string.

28
New cards

String immutability

Strings cannot be changed after creation; operations produce new String objects.

29
New cards

substring

Extracts a portion of a string; end index is exclusive.

30
New cards

Scanner

Class for obtaining input from sources like the keyboard (System.in).

31
New cards

printf

Print formatted text using format specifiers (e.g., %d, %f, %s).

32
New cards

String.format

Creates a formatted string without printing it; returns the formatted string.

33
New cards

NumberFormat

Formats numbers as currency, percentages, etc., with locale support.

34
New cards

DecimalFormat

Subclass of NumberFormat that formats numbers using custom patterns.

35
New cards

Locale

Represents a region for formatting rules

36
New cards

if statement

Conditional that executes code only when its boolean condition is true.

37
New cards

switch statement

Multi-branch conditional that selects a block based on an expression's value; uses break to avoid fall-through.

38
New cards

while loop

Loop that repeatedly executes as long as a condition remains true.

39
New cards

do-while loop

Loop that executes its body at least once, then repeats while condition is true.

40
New cards

for loop

Pre-test loop with initialization, condition, and update that repeats while the condition holds.

41
New cards

break

Exits the nearest enclosing loop or switch statement.

42
New cards

continue

Skips the current iteration and proceeds to the next loop iteration.

43
New cards

short-circuit evaluation

In && and ||, evaluation can stop early if the result is determined from the left side.

44
New cards

exception

An error that occurs during runtime; represented by the Throwable hierarchy.

45
New cards

try-catch-finally

Structure to handle exceptions: try executes risk code, catch handles specified exceptions, finally runs always.

46
New cards

throw

Operator to create and raise an exception object.

47
New cards

throws

Declaration that a method may throw certain checked exceptions.

48
New cards

File I/O

Input and output with files using classes like File, Scanner, and PrintWriter; may throw IOExceptions.

49
New cards

ArrayList

Resizable array implementation of List; grows automatically as elements are added.

50
New cards

LinkedList

List implemented as nodes linked together; supports efficient insertions/removals.

51
New cards

Generics

Parameterized types that allow code to be type-safe (e.g., ArrayList).

52
New cards

Comparable

Interface for objects that have a natural ordering via compareTo.

53
New cards

compareTo

Method returning negative, zero, or positive to indicate ordering.

54
New cards

inheritance

Mechanism for a subclass to reuse the state and behavior of a superclass.

55
New cards

polymorphism

Ability to treat objects of different classes through a common interface or superclass.

56
New cards

interface

Contract declaring abstract methods that implementing classes must define.

57
New cards

implements

Keyword indicating a class implements an interface.

58
New cards

constructor

Special method to initialize a new object; has the same name as the class and no return type.

59
New cards

this

Reference to the current object inside an instance method or constructor.

60
New cards

toString

Method that returns a readable string representation of an object; often overridden.

61
New cards

encapsulation

Hiding internal object state and accessing it via public methods.

62
New cards

default constructor

No-argument constructor automatically provided if no other constructors are defined.

63
New cards

overloading

Defining multiple methods with the same name but different parameter lists.