1/72
Flashcards covering fundamental Java concepts, data types, operators, and control flow statements like if, if-else, and else-if, extracted from lecture notes.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Object-Oriented Programming (OOP)
A programming paradigm that focuses on robust, modular, and reusable code through encapsulation, inheritance, polymorphism, and abstraction - is essential in modern software development.
Dynamic Language
A type of programming language, like Python, often characterized by a sparse, clear syntax, consistent object model, and being typically 'informal' in its structure and type handling.
Industrial Strength Languages
Programming languages such as Java, Rust, C++, C#, and Ada, which are typically more formal, offer better performance, and are designed for large-scale projects with multiple developers, emphasizing maintainability and strictness.
Java Standard Library
A comprehensive collection of predefined classes (over 4,000 in Java 14 Standard Edition) that enables the creation of sophisticated Java programs without extensive external dependencies.
Automatic Garbage Collection
A feature in Java that automatically manages and deallocates memory that is no longer in use.
Main Method
The designated entry point for the execution of an executable Java program, defined as public static void main(String[] args)
.
System.out.println();
A Java command used to display text output to the console, followed by a new line.
String Literal
A sequence of characters enclosed in double quotes (e.g., "Hello World!") used to represent fixed text in Java.
Curly Braces ({})
Used in Java to delimit blocks of code, such as class definitions, method definitions, or statements within conditional and loop structures.
Semicolon (;)
A required punctuation mark in Java that signifies the end of a statement, similar to a period in English.
System.out.print();
A Java command used to display text output to the console without advancing to a new line.
System.out.printf();
A Java method used to format and display text output to the console, allowing for specified formatting of variables within the output.
Compiler
A software tool that translates Java source code files (.java) into machine-readable bytecode files (.class), detecting syntax errors in the process.
Syntax Errors
Errors in Java code that violate the language's grammatical rules, detected by the compiler during the compilation phase, such as missing semicolons or unmatched braces.
Bug
An informal term for an error or flaw in computer code that causes unexpected behavior or prevents a program from running correctly.
Debugging
The systematic process of identifying, analyzing, and removing errors (bugs) from a computer program.
Compile Time Error
An error identified and reported by the compiler during the process of converting source code into bytecode, often due to incorrect syntax.
Single-line Comment
In Java, explanatory text marked by //
that extends to the end of the line, ignored by the compiler.
Multi-line Comment
In Java, explanatory text enclosed between /*
and */
that can span multiple lines, ignored by the compiler.
Interpreted Language
A programming language, such as Python, where program instructions are executed directly by an interpreter without a separate prior compilation step.
javac
The Java compiler command-line tool used to convert Java source code (.java
files) into Java bytecode (.class
files).
Bytecode (.class file)
The platform-independent intermediate code generated by the Java compiler from source code, which is then executed by the Java Virtual Machine (JVM).
java
(command)
The command-line tool used to launch and execute Java applications by running compiled bytecode through the Java Virtual Machine.
Java Virtual Machine (JVM)
An abstract computing machine that enables a computer to run Java programs by interpreting Java bytecode, providing a runtime environment.
Code Block
A group of zero or more statements in Java enclosed within a pair of curly braces {}
.
public
(keyword)
A Java access modifier that signifies a class, method, or variable is accessible from any other class.
static
(keyword)
A Java keyword indicating that a member (method or variable) belongs to the class itself, rather than to any specific instance of the class.
void
(keyword)
A Java keyword used in method declarations to indicate that the method does not return any value.
String[] args
The parameter list of the main
method, representing an array of String
objects that can be used to pass command-line arguments to the Java program.
System.out
The standard output stream object in Java, used for displaying information to the console.
Dot Notation
A syntax used in Java (and other languages) to access members (fields or methods) of an object or class (e.g., object.method()
, Class.field
).
Whitespace (Java)
Characters like spaces, tabs, and newlines that are generally ignored by the Java compiler, unlike in some other languages (e.g., Python) where they can be syntactically meaningful.
Variable
A named storage location in a computer's memory that holds a value, which can change or vary during program execution.
Primitive Variables
Variables in Java that directly store fundamental data types like int
, double
, and boolean
, holding the actual value in memory.
Object/Reference Variables
Variables in Java that store a 'reference' (memory address) to an object, rather than the object's value itself.
int
(data type)
A primitive data type in Java used to store 32-bit signed integer values (whole numbers).
double
(data type)
A primitive data type in Java used to store 64-bit double-precision floating-point numbers (decimal numbers).
boolean
(data type)
A primitive data type in Java used to store logical values, which can only be true
or false
.
char
(data type)
A primitive data type in Java used to store a single 16-bit Unicode character, enclosed in single quotes (e.g., 'A', '7').
byte
(data type)
A primitive data type in Java used to store 8-bit signed integer values, with a range from -128 to 127, useful for memory efficiency.
short
(data type)
A primitive data type in Java used to store 16-bit signed integer values, with a range from -32,768 to 32,767.
long
(data type)
A primitive data type in Java used to store 64-bit signed integer values, for numbers exceeding the range of int
(literals typically suffixed with 'L').
float
(data type)
A primitive data type in Java used to store 32-bit single-precision floating-point numbers, less precise than double
(literals typically suffixed with 'F').
String
(data type)
A non-primitive (object) data type in Java representing a sequence of characters, used for text, and enclosed in double quotes.
Type (data type)
In programming, a classification that defines a set of values (its domain) and the operations that can be performed on those values.
Declaring a Variable
The process of creating a variable in Java by specifying its data type and a unique name, which reserves memory for it.
Bits (Binary Digits)
The smallest unit of information in computing, capable of representing two values, typically 0 or 1.
String Concatenation Operator (+)
The operator used in Java to join two or more strings together, or to combine strings with other data types for output.
Java Keywords/Reserved Words
Words that have predefined meanings in the Java language and cannot be used as identifiers (variable names, class names, etc.).
Case-Sensitive
A characteristic of Java where uppercase and lowercase letters are treated as distinct; for example, myVariable
and MyVariable
are considered different identifiers.
Assignment Statement
A programming statement that stores the value of an expression on the right-hand side into the variable specified on the left-hand side.
Assignment Operator (=)
The operator in Java used to assign a value to a variable (e.g., score = 10;
).
Variable Increment
The operation of increasing a variable's current value, typically by a specific amount like one (e.g., score = score + 1;
).
Scanner
class
A utility class in Java that allows programs to read various types of input (e.g., numbers, strings) from the keyboard or other input sources.
scan.nextLine()
A method of the Scanner
class used to read an entire line of text input from the console until a newline character is encountered.
Arithmetic Operators
Standard mathematical operators in Java, including +
(addition), -
(subtraction), *
(multiplication), /
(division), and %
(modulo/remainder).
Integer Division
An arithmetic operation in Java where dividing two int
values results in an int
value, truncating (dropping) any fractional part of the result.
Division by Zero
An illegal operation in integer arithmetic in Java that throws an ArithmeticException
because the result is undefined.
==
(Equality Operator)
A relational operator in Java used to test if two values are equal, returning a true
or false
boolean result.
!=
(Not Equal Operator)
A relational operator in Java used to test if two values are not equal, returning a true
or false
boolean result.
Operator Precedence
Rules that determine the order in which operators in an expression are evaluated; for example, multiplication, division, and modulo generally occur before addition and subtraction.
Modulo Operator (%
)
An arithmetic operator in Java that returns the remainder of a division operation (e.g., 10 % 3
results in 1
).
Boolean Expression
An expression that evaluates to a boolean value, which can only be true
or false
.
Relational Operators
Operators in Java (<
, >
, <=
, >=
, ==
, !=
) used to compare two numeric values or expressions, resulting in a boolean true
or false
value.
compareTo()
and equals()
(String methods)
Methods used in Java for comparing String
objects, as relational operators like ==
are not typically used for meaningful string value comparison.
if
Statement (Conditional/Selection)
A control flow statement in Java that executes a block of code only if its specified boolean condition evaluates to true
.
Flow of Control
The order in which statements in a program are executed. Conditional statements, loops, and method calls can alter this sequential flow.
if-else
Statement
A two-way conditional statement in Java that executes one block of code if its boolean condition is true
and a different block if the condition is false
.
if-else-if
Statement (Multi-way conditional)
A control flow construct in Java that handles multiple conditions sequentially, executing the block of code associated with the first true
condition encountered.
Logical OR (||
)
A logical operator in Java that returns true
if at least one (one, or the other, or both) of its boolean operands is true
(inclusive OR).
Logical NOT (!
)
A logical operator in Java that inverts the boolean value of its operand; true
becomes false
, and false
becomes true
.
Inclusive-OR
Describes the behavior of the logical OR operator (||
) where the combined expression is true if the first condition is true, or the second condition is true, or both conditions are true.
Short-Circuit Evaluation
A feature of the &&
(AND) and ||
(OR) logical operators in Java where the right-hand operand is not evaluated if the overall result can be determined solely by the left-hand operand.