COMP 155: Object Oriented Programming Overview

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

1/112

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

113 Terms

1
New cards

Package

Mechanism for organizing class namespaces in Java.

2
New cards

Declaring Package

Use 'package pkg' to define a package.

3
New cards

File System Directories

Packages stored in directories matching their names.

4
New cards

Package Syntax

Form: package pkg1[.pkg2[.pkg3]].

5
New cards

Import Statement

Allows access to classes from other packages.

6
New cards

Omitting Import Statement

Classes can be used with full package names.

7
New cards

Access Protection

Controls visibility of classes and members.

8
New cards

Public Access Modifier

Members accessible from any class.

9
New cards

Private Access Modifier

Members inaccessible outside their class.

<p>Members inaccessible outside their class.</p>
10
New cards

Default Access Modifier

Visible to subclasses and same package classes.

11
New cards

Protected Access Modifier

Visible to subclasses and same package classes.

12
New cards

Class Declaration

Defines access levels for classes in Java.

13
New cards

Non-Nested Class

Only has public and default access levels.

14
New cards

Single Public Class

Only one public class per '.java' file.

15
New cards

Nested Class

Can be private or protected.

16
New cards

I/O Streams

Abstractions for input and output operations.

<p>Abstractions for input and output operations.</p>
17
New cards

Stream

Abstraction that produces or consumes information.

18
New cards

Physical Device

Stream linked to devices via Java I/O system.

19
New cards

Byte Stream

Handles binary data in Java.

20
New cards

Character Stream

Handles character data in Java.

21
New cards

Java I/O Package

Contains classes for input and output operations.

22
New cards

Accessibility of Members

Determines how class members can be accessed.

23
New cards

Hierarchy of Packages

Packages can be nested using '.' notation.

24
New cards

Stream

Java's method for handling input and output.

25
New cards

Byte Stream

Handles input/output of bytes, e.g., binary data.

26
New cards

Character Stream

Handles input/output of characters, supports Unicode.

27
New cards

InputStream

Abstract class for reading byte streams.

28
New cards

OutputStream

Abstract class for writing byte streams.

29
New cards

Reader

Abstract class for reading character streams.

30
New cards

Writer

Abstract class for writing character streams.

31
New cards

System

Encapsulates aspects of Java's run-time environment.

32
New cards

System.in

Standard input stream, defaults to keyboard.

33
New cards

System.out

Standard output stream, defaults to console.

34
New cards

System.err

Standard error stream, defaults to console.

35
New cards

PrintStream

Class for writing output to byte streams.

36
New cards

BufferedReader

Reads text from character input stream efficiently.

<p>Reads text from character input stream efficiently.</p>
37
New cards

InputStreamReader

Converts byte streams to character streams.

38
New cards

read() method

Reads a single character from input.

39
New cards

readLine() method

Reads a line of text from input.

40
New cards

write() method

Writes bytes to output stream.

41
New cards

Buffered Input Stream

Supports efficient reading of characters.

42
New cards

Internationalization

Adapting software for different languages and regions.

43
New cards

Console Input

Input from the user via the console.

44
New cards

Console Output

Output displayed to the user via the console.

45
New cards

Low-level method

Basic method for writing data to streams.

46
New cards

Character-based stream

Stream designed for handling characters efficiently.

47
New cards

PrintWriter

Character-based class for console output.

<p>Character-based class for console output.</p>
48
New cards

flushingOn

Controls automatic flushing of output stream.

49
New cards

PrintWriter constructor

PrintWriter(OutputStream, boolean) initializes output stream.

50
New cards

toString() method

Converts object to string for display.

51
New cards

File I/O

Reading and writing data to files.

52
New cards

Byte streams

Handles raw binary data in files.

53
New cards

Character streams

Handles character data in files.

54
New cards

BufferedOutputStream

Buffers output for improved performance.

55
New cards

flush() method

Flushes buffered content to the output stream.

56
New cards

Serialization

Converts object state to byte stream.

57
New cards

Deserialization

Converts byte stream back to object.

58
New cards

Serializable interface

Marks classes for serialization support.

59
New cards

FileInputStream

Reads bytes from a file.

60
New cards

FileOutputStream

Writes bytes to a file.

61
New cards

FileReader

Reads characters from a file.

62
New cards

FileWriter

Writes characters to a file.

63
New cards

BufferedOutputStreamExample

Example class demonstrating buffered output.

64
New cards

try-finally block

Ensures resources are closed after use.

65
New cards

int c

Variable for reading single bytes/characters.

66
New cards

System.out

Standard output stream in Java.

67
New cards

PrintWriter methods

Includes print() and println() for output.

68
New cards

Serializable

Interface allowing object serialization in Java.

69
New cards

ObjectOutputStream

Writes objects to an output stream.

<p>Writes objects to an output stream.</p>
70
New cards

ObjectInputStream

Reads objects from an input stream.

71
New cards

Down-casting

Casting a superclass reference to a subclass.

72
New cards

Generics

Parameterized types for type-safe programming.

<p>Parameterized types for type-safe programming.</p>
73
New cards

Type safety

Ensures data types are correctly used.

74
New cards

Autoboxing

Automatic conversion between primitive types and wrapper classes.

75
New cards

Wrapper classes

Classes that encapsulate primitive data types.

76
New cards

NonGen

Class demonstrating non-generic object handling.

77
New cards

Explicit casting

Manually converting one type to another.

78
New cards

Bounded Types

Restricts types used in generics to subclasses.

79
New cards

Stats class

Generic class for statistical calculations.

80
New cards

Average method

Calculates average of numeric array elements.

81
New cards

Upper Bound

Wildcard allowing subclasses of a specified class.

82
New cards

Lower Bound

Wildcard allowing superclasses of a specified class.

83
New cards

Generic Methods

Methods that operate on generic types.

84
New cards

JDK 5

Java Development Kit version introducing generics.

85
New cards

Type parameter

Specifies data type for generics.

86
New cards

Compile-time error

Error detected during code compilation.

87
New cards

Run-time error

Error occurring during program execution.

88
New cards

Generic class syntax

class ClassName.

89
New cards

Multiple bounds

Combining multiple constraints in generics.

90
New cards

Generic Method

A method that can operate on various types.

91
New cards

Type Inference

Compiler determines generic type parameters automatically.

92
New cards

Diamond Operator

<> used for type inference in generics.

93
New cards

ArrayList

Resizable array implementation in Java collections.

94
New cards

Wrapper Class

Object representation of primitive data types.

95
New cards

Fixed-size Array

Array with a set number of elements.

96
New cards

Element Index

Zero-based position of an element in an array.

97
New cards

Array Length

Total number of elements in an array.

98
New cards

List Abstraction

Dynamic collection that resizes as needed.

99
New cards

Generic Type

Type parameter used in class or method definitions.

100
New cards

ArrayList Methods

Functions for manipulating ArrayList objects.