1/112
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Package
Mechanism for organizing class namespaces in Java.
Declaring Package
Use 'package pkg' to define a package.
File System Directories
Packages stored in directories matching their names.
Package Syntax
Form: package pkg1[.pkg2[.pkg3]].
Import Statement
Allows access to classes from other packages.
Omitting Import Statement
Classes can be used with full package names.
Access Protection
Controls visibility of classes and members.
Public Access Modifier
Members accessible from any class.
Private Access Modifier
Members inaccessible outside their class.
Default Access Modifier
Visible to subclasses and same package classes.
Protected Access Modifier
Visible to subclasses and same package classes.
Class Declaration
Defines access levels for classes in Java.
Non-Nested Class
Only has public and default access levels.
Single Public Class
Only one public class per '.java' file.
Nested Class
Can be private or protected.
I/O Streams
Abstractions for input and output operations.
Stream
Abstraction that produces or consumes information.
Physical Device
Stream linked to devices via Java I/O system.
Byte Stream
Handles binary data in Java.
Character Stream
Handles character data in Java.
Java I/O Package
Contains classes for input and output operations.
Accessibility of Members
Determines how class members can be accessed.
Hierarchy of Packages
Packages can be nested using '.' notation.
Stream
Java's method for handling input and output.
Byte Stream
Handles input/output of bytes, e.g., binary data.
Character Stream
Handles input/output of characters, supports Unicode.
InputStream
Abstract class for reading byte streams.
OutputStream
Abstract class for writing byte streams.
Reader
Abstract class for reading character streams.
Writer
Abstract class for writing character streams.
System
Encapsulates aspects of Java's run-time environment.
System.in
Standard input stream, defaults to keyboard.
System.out
Standard output stream, defaults to console.
System.err
Standard error stream, defaults to console.
PrintStream
Class for writing output to byte streams.
BufferedReader
Reads text from character input stream efficiently.
InputStreamReader
Converts byte streams to character streams.
read() method
Reads a single character from input.
readLine() method
Reads a line of text from input.
write() method
Writes bytes to output stream.
Buffered Input Stream
Supports efficient reading of characters.
Internationalization
Adapting software for different languages and regions.
Console Input
Input from the user via the console.
Console Output
Output displayed to the user via the console.
Low-level method
Basic method for writing data to streams.
Character-based stream
Stream designed for handling characters efficiently.
PrintWriter
Character-based class for console output.
flushingOn
Controls automatic flushing of output stream.
PrintWriter constructor
PrintWriter(OutputStream, boolean) initializes output stream.
toString() method
Converts object to string for display.
File I/O
Reading and writing data to files.
Byte streams
Handles raw binary data in files.
Character streams
Handles character data in files.
BufferedOutputStream
Buffers output for improved performance.
flush() method
Flushes buffered content to the output stream.
Serialization
Converts object state to byte stream.
Deserialization
Converts byte stream back to object.
Serializable interface
Marks classes for serialization support.
FileInputStream
Reads bytes from a file.
FileOutputStream
Writes bytes to a file.
FileReader
Reads characters from a file.
FileWriter
Writes characters to a file.
BufferedOutputStreamExample
Example class demonstrating buffered output.
try-finally block
Ensures resources are closed after use.
int c
Variable for reading single bytes/characters.
System.out
Standard output stream in Java.
PrintWriter methods
Includes print() and println() for output.
Serializable
Interface allowing object serialization in Java.
ObjectOutputStream
Writes objects to an output stream.
ObjectInputStream
Reads objects from an input stream.
Down-casting
Casting a superclass reference to a subclass.
Generics
Parameterized types for type-safe programming.
Type safety
Ensures data types are correctly used.
Autoboxing
Automatic conversion between primitive types and wrapper classes.
Wrapper classes
Classes that encapsulate primitive data types.
NonGen
Class demonstrating non-generic object handling.
Explicit casting
Manually converting one type to another.
Bounded Types
Restricts types used in generics to subclasses.
Stats class
Generic class for statistical calculations.
Average method
Calculates average of numeric array elements.
Upper Bound
Wildcard allowing subclasses of a specified class.
Lower Bound
Wildcard allowing superclasses of a specified class.
Generic Methods
Methods that operate on generic types.
JDK 5
Java Development Kit version introducing generics.
Type parameter
Specifies data type for generics.
Compile-time error
Error detected during code compilation.
Run-time error
Error occurring during program execution.
Generic class syntax
class ClassName
Multiple bounds
Combining multiple constraints in generics.
Generic Method
A method that can operate on various types.
Type Inference
Compiler determines generic type parameters automatically.
Diamond Operator
<> used for type inference in generics.
ArrayList
Resizable array implementation in Java collections.
Wrapper Class
Object representation of primitive data types.
Fixed-size Array
Array with a set number of elements.
Element Index
Zero-based position of an element in an array.
Array Length
Total number of elements in an array.
List Abstraction
Dynamic collection that resizes as needed.
Generic Type
Type parameter used in class or method definitions.
ArrayList Methods
Functions for manipulating ArrayList objects.