Introduction to Java Programming Flashcards
It marks the beginning of a comment
//
Is associated with the beginning of the class definition. All of the programming statements that are part of the class are enclosed in this.
{}
Marks the beginning of a single line comment
// //(Double slash)
Marks the beginning of a multiple line comment
/* */
Used in a method header
{ } (Opening and closing braces)
Encloses a string of characters, such as a message that is to be printed on the screen
” “ (Quotation marks)
Marks the end of a complete programming statement
; (Semicolon)
Is part of the Java API. It has member objects and methods for performing system-level operations, such as sending output to the console.
The System class
is a member of the System class. It provides methods for sending output to the screen.
The out object
are members of the out object. They actually perform the work of writing characters on the screen.
The print and println methods
It displays output on the screen and does not advance the cursor to the next line after its message is displayed
print method
It displays its message, it advances the cursor to the beginning of the next line
println method
Advances the cursor to the next line for subsequent printing
\n (Newline)
Causes the cursor to skip over to the next tab stop
\t (Horizontal tab)
Inserts a backspace into the text at this point.
\b (Backspace)
Causes the cursor to go to the beginning of the current line not the next line
\r (Return)
Causes a backslash to be printed
\ (Backslash)
Causes a single quotation mark to be printed
\’ (Single quote)
A punctuation mark used in a method header.
\“(Double quote)
Types of programming error
Syntax error, Runtime error, Logical error
It is also called parsing errors
Syntax error
It occurs at compile time in traditional programming languages and at interpret time in interpreter
Syntax error
Any violation of rules and poor understanding of the programming language results to this error.
Syntax error
It is also called exceptions occur during execution (after compilation/ interpretation).
Runtime error
Some examples are, dividing by zero error, insufficient memory for dynamic memory allocation, referencing out-of-range array element.
Runtime error
These are not detected by com-piler while compilation process.
Runtime error