computer comments Flashcards
These are ignored by the compiler.
* It is used by the programmer to leave notes for themselves and for
those who might read their programs in the future.
* It is also used to help out the programmer to locate the possible error
of the program by commenting out some statements that may cause
the error.
* It is the “eraser” of programmers.
comments
TYPES OF COMMENTS
Line comment
Block Comment
Javadoc
It starts with 2 slashes (//)
Line comment
It starts with (/) and ends with (/)
Block Comment
special case of block comments.
- It starts with (/**) and ends with (*/)
Javadoc
T or F
The filename can’t always be the same as the name of the class.
F
T or F
file name must have “.java” extension
T
enumerate the steps in compiling a java class
- Open command prompt
- Go to the folder where the program (code) is saved.
- Enter: “javac First.java”
T or F
There can be 3 output after compiling:
1. No message – success compilation
2. Programming language error – syntax error in the code.
3. Javac not recognized error -
T
enumerate the steps in MODIFYING A JAVA PROGRAM
- Open the java source code.
- Add the modifications.
- Recompile the class
- Rerun the application
when the value of data item cannot be changed while running a program.
constant
can be refer as literal constant, numeric constant, unnamed
constant or simply, hard-coded.
459
a named memory location that can store a value.
- It can only hold one value but the value it hold can be
changed.
Variable
describes the type of data that can be stored, how much memory the item occupies and types of operation that can be perform on the data.
Data type
is a statement that reserves a named memory
location and includes the following:
varieble declaration
that identifies the type of data that the variable will store
data type
variable’s name
identifier
if you want a variable to contain an initial value
An optional assignment operator (=) and assigned value,
begins with lowercase letter and capitalizing subsequent words within the identifier.
Camel Casing
what is Example: int myAge = 21;
example of initialized variable.