chap 1 -revisited Flashcards
re=written cards
compile time error?
code errors found in compiler
logic error?
code does not execute as intended but it does pass the compiler
run time error?
code passes the compiler but the program terminates itself abnormally.
debugging?
code is checked for logic errors and fixed
/* */ –> what does this do?
all the comments written between the slashes and asterics is commented out and does not get executed in the code. /* comments here */
/** */ does what?
sends documentation to an external file.
main method
what is it?
main method: processing of code begins here but the main method also needs to be preceeded by public, void or static.
what does the word: void , public or static
mean before main method?
void: means there is no output.
public: means that any program or class can have access to the code in the main method.
- static: means that the data does not change.
what are Identifiers?
Identifiers: words used when writing programs.
to concatenate?
concatenate: used to connect two strings together. The plus + sign is used.
–used when a string statement takes up two lines of code within the program.
“code is written here but”
+ “ ran out of room so we concatenated them using + “
concatenate a string to numbers how?
just use the + symbol as long as one side is a string then both become a string.
how to not accidentally use concatenation when trying to add two numbers together?
make sure you put the arithmetic within a set of parentheses with a concatenation infront and outside of the () .
escape sequences are?
\ keys allow special characters to be used within the code instead of being seen by the java editor as an action like the end of a string. for instance
" will show a quotation mark but had the “ been used without the slash then the compiler would think it is the start of a string.
what are some escape sequences?
\n new line \t tab in \r carriage return \\ shows a backslash \" shows a quotation mark
Variable?
where is it listed usually? what do we call it when we list it?
declare a variable means to just enter the variable name and end it with a ; at the end.
–a variable is a word that is chosen by the programmer to then be called on later in the code.