1/23
Flashcards covering key Java programming concepts, syntax, and definitions from the lecture notes.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Statement Terminator
Every complete statement in Java ends with a period.
Literals
Fixed values or data examples like 72, 'A', "Hello World", 2.8712.
Braces ({})
Enclosures for a group of statements, such as the contents of a class or a method.
Negation Operator
A unary operator.
final keyword
Used to declare a named constant, preventing its value from being changed.
Multi-line Comment
Starts with /* and ends with */.
Single-line Comment
Starts with // and ends at the end of the line.
Documentation Comment
Starts with /** and ends with */, typically processed by javadoc.
Scanner.nextLine()
The Scanner class method used to read a string as input.
Scanner.nextDouble()
The Scanner class method used to read a double as input.
JOptionPane
A class used to display dialog boxes.
Widening Conversion
When Java converts a lower-ranked value to a higher-ranked type automatically.
Cast Operator
Allows manual conversion of a value, even if it results in a narrowing conversion.
Variable Declaration
Statement that tells the Java compiler the variable's name and the type of data it will hold.
Self-documenting Program
A program whose code is easy to understand just by reading it, often due to clear variable names and comments.
Case-sensitive Language
A language (like Java) that regards uppercase letters as entirely different characters than their lowercase counterparts.
System.out.print/println
Methods of the 'out' object, which is contained within the System class, used for output to the console.
Data Type Considerations
When choosing a data type, consider the nature of the data, the amount of memory the variable uses, and how it formats and stores data.
Variable Assignment
Giving a value to an already declared variable.
Variable Initialization
Declaring a variable with a data type and assigning its initial value simultaneously.
Programming Style
The way a programmer uses spaces, indentations, blank lines, and punctuation to visually arrange source code, promoting organization and readability.
Named Constant Advantage
Makes programs more self-documenting and allows for easy, widespread changes to a value across the program.
javadoc command
Used to generate HTML documentation files from Java source files containing documentation comments (e.g., javadoc SalesAverage.java).
Type Promotion (Arithmetic)
When an expression adds a byte variable and a short variable, the result will be an int type due to type promotion rules in Java.