Java Programing Basics Flashcards
String Literal
Text in double quotes “
Comment
is text a programmer adds to code, to be read by humans to better understand the code but ignored by the compiler. Two common kinds of comments exist:
single-line comment
multi-line comment
Single-line Comment
starts with // and includes all the following text on that line. Single-line comments commonly appear after a statement on the same line.
Multi-line Comment
starts with /* and ends with /, where all text between / and */ is part of the comment. A multi-line comment is also known as a block comment.
Whitespace
refers to blank spaces (space and tab characters) between items within a statement and blank lines between statements (called newlines). A compiler ignores most whitespace.
Syntax Error
is to violate a programming language’s rules on how symbols can be combined to create a program. An example is forgetting to end a statement with a semicolon.
Because a syntax error is detected by the compiler, a syntax error is known as a type of
Compile-time Error
Logic Error
also called a bug, is an error that occurs while a program runs. For example, a programmer might mean to type numBeans * numJars but accidentally types numBeans + numJars (+ instead of *). The program would compile but would not run as intended.
int
is the most commonly used integer type
long
is used for integers expected to exceed about 2 billion