computer comments Flashcards

1
Q

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.

A

comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

TYPES OF COMMENTS

A

Line comment
Block Comment
Javadoc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

It starts with 2 slashes (//)

A

Line comment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

It starts with (/) and ends with (/)

A

Block Comment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

special case of block comments.
- It starts with (/**) and ends with (*/)

A

Javadoc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

T or F
The filename can’t always be the same as the name of the class.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

T or F
file name must have “.java” extension

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

enumerate the steps in compiling a java class

A
  • Open command prompt
  • Go to the folder where the program (code) is saved.
  • Enter: “javac First.java”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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 -

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

enumerate the steps in MODIFYING A JAVA PROGRAM

A
  • Open the java source code.
  • Add the modifications.
  • Recompile the class
  • Rerun the application
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

when the value of data item cannot be changed while running a program.

A

constant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

can be refer as literal constant, numeric constant, unnamed
constant or simply, hard-coded.

A

459

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

a named memory location that can store a value.
- It can only hold one value but the value it hold can be
changed.

A

Variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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.

A

Data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

is a statement that reserves a named memory
location and includes the following:

A

varieble declaration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

that identifies the type of data that the variable will store

A

data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

variable’s name

A

identifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

if you want a variable to contain an initial value

A

An optional assignment operator (=) and assigned value,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

begins with lowercase letter and capitalizing subsequent words within the identifier.

A

Camel Casing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what is Example: int myAge = 21;

A

example of initialized variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

what is example: int myAge;

A

uninitialized variable

22
Q

Uninitialized variable – contains what unknown value

A

garbage value

23
Q

to declare 2 or more variables of the same type in a single statement, it is separated by a comma.

A

Multiple variable declaration

24
Q

the value of the location should not be changed
during execution.

A

Named Constant

25
T or F Named constant is similar to variable: it has data type, name, value.
T
26
In order to concatenate variable to a String, we need to use what sign?
plus sign (+)
27
Integer Data Types
All of integer data type are signed (+ or -)
28
3. Declaring integer data type: * --- (variable) * ---- (variable) * ----- (variable) * ---- (variable)
int byte short long
29
It is a logic that is based on TRUE or FALSE comparisons.
boolean data type
30
use to compare two items. - also called “comparison operators
relational operator
31
number contains decimal.
Floating-point
32
point data types
two floating
33
data type that can hold values up to 6 or 7 significant accuracy
float
34
data type that can hold values up to 14 or 15 significant accuracy.
double
35
– data type to hold single character.
char
36
built-in class that provides the means for storing and manipulating character strings.
String
37
To declare String: String (variable) =
“value”
38
special characters that begins with a backslash
Escape Sequence
39
is used for obtaining the input of the primitive data type.
Scanner
40
Scanner (variable) =
new Scanner(System.in);
41
is the principle in creating private access. an important component of Object-Oriented programs.
Information hiding
42
Java supports two types of division
Floating-point division Integer division
43
– occurs when both operand are integers
Integer division
44
occurs when either or both operands are floating-point values.
Floating-point division –
45
is the process of converting one data type to another.
Type conversion –
46
* Types of Conversion
1. Implicit Conversion 2. Explicit Conversion
47
it automatically converts nonconforming operands to the unifying type. It is also called Promotions.
1. Implicit Conversion
48
is the type to which all operands in an expression are converted so that they are compatible to each other
Unifying type –
49
is the overriding the unifying type.
Explicit Conversion
50
forces the value of one data type to be used as a value of another data type.
Type Casting
51
is created by placing the desired result type in parenthesis.
Cast Operator –