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
Q

T or F
Named constant is similar to variable: it has data type, name, value.

A

T

26
Q

In order to concatenate variable to a String, we need to use what sign?

A

plus sign (+)

27
Q

Integer Data Types

A

All of integer data type are signed (+ or -)

28
Q
  1. Declaring integer data type:
    * — (variable)
    * —- (variable)
    * —– (variable)
    * —- (variable)
A

int
byte
short
long

29
Q

It is a logic that is based on TRUE or FALSE comparisons.

A

boolean data type

30
Q

use to compare two items.
- also called “comparison operators

A

relational operator

31
Q

number contains decimal.

A

Floating-point

32
Q

point data types

A

two floating

33
Q

data type that can hold values up to 6 or 7 significant
accuracy

A

float

34
Q

data type that can hold values up to 14 or 15 significant accuracy.

A

double

35
Q

– data type to hold single character.

A

char

36
Q

built-in class that provides the means for storing and manipulating character strings.

A

String

37
Q

To declare String: String (variable) =

A

“value”

38
Q

special characters that begins with a backslash

A

Escape Sequence

39
Q

is used for obtaining the input of the primitive data type.

A

Scanner

40
Q

Scanner (variable) =

A

new Scanner(System.in);

41
Q

is the principle in creating private access.
an important component of Object-Oriented
programs.

A

Information hiding

42
Q

Java supports two types of division

A

Floating-point division
Integer division

43
Q

– occurs when both operand are integers

A

Integer division

44
Q

occurs when either or both operands are
floating-point values.

A

Floating-point division –

45
Q

is the process of converting one data type to
another.

A

Type conversion –

46
Q
  • Types of Conversion
A
  1. Implicit Conversion
  2. Explicit Conversion
47
Q

it automatically converts nonconforming operands to the unifying type. It is also called Promotions.

A
  1. Implicit Conversion
48
Q

is the type to which all operands in an expression are converted so that they are compatible to each other

A

Unifying type –

49
Q

is the overriding the unifying type.

A

Explicit Conversion

50
Q

forces the value of one data type to be used as a value of another data type.

A

Type Casting

51
Q

is created by placing the desired result type in
parenthesis.

A

Cast Operator –