Introduction to Java Programming Flashcards

1
Q

It marks the beginning of a comment

A

//

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

Is associated with the beginning of the class definition. All of the programming statements that are part of the class are enclosed in this.

A

{}

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

Marks the beginning of a single line comment

A

// //(Double slash)

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

Marks the beginning of a multiple line comment

A

/* */

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

Used in a method header

A

{ } (Opening and closing braces)

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

Encloses a string of characters, such as a message that is to be printed on the screen

A

” “ (Quotation marks)

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

Marks the end of a complete programming statement

A

; (Semicolon)

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

Is part of the Java API. It has member objects and methods for performing system-level operations, such as sending output to the console.

A

The System class

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

is a member of the System class. It provides methods for sending output to the screen.

A

The out object

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

are members of the out object. They actually perform the work of writing characters on the screen.

A

The print and println methods

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

It displays output on the screen and does not advance the cursor to the next line after its message is displayed

A

print method

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

It displays its message, it advances the cursor to the beginning of the next line

A

println method

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

Advances the cursor to the next line for subsequent printing

A

\n (Newline)

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

Causes the cursor to skip over to the next tab stop

A

\t (Horizontal tab)

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

Inserts a backspace into the text at this point.

A

\b (Backspace)

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

Causes the cursor to go to the beginning of the current line not the next line

A

\r (Return)

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

Causes a backslash to be printed

A

\ (Backslash)

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

Causes a single quotation mark to be printed

A

\’ (Single quote)

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

A punctuation mark used in a method header.

A

\“(Double quote)

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

Types of programming error

A

Syntax error, Runtime error, Logical error

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

It is also called parsing errors

A

Syntax error

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

It occurs at compile time in traditional programming languages and at interpret time in interpreter

A

Syntax error

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

Any violation of rules and poor understanding of the programming language results to this error.

A

Syntax error

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

It is also called exceptions occur during execution (after compilation/ interpretation).

A

Runtime error

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

Some examples are, dividing by zero error, insufficient memory for dynamic memory allocation, referencing out-of-range array element.

A

Runtime error

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

These are not detected by com-piler while compilation process.

A

Runtime error

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

The most difficult type of errors to track down.

A

Logical error

28
Q

They occur when you make a mistake in the logic that drives your program and you do not get the result you expected.

A

Logical error

29
Q

These errors occur due to incorrect translation of algorithm into the program, poor understanding of the problem and a lack of clarity of hierarchy of operators

A

Logical error

30
Q

It is a programmer-defined name that represents some element of a program

A

Identifiers

31
Q

Examples of Identifiers

A

Variable names and class names

32
Q

Beginning an identifier with a lowercase letter and capitalizing subsequent words within the identifier is a style known as ____?

A

Camel Casing

33
Q

describes the type of data that can be stored there, how much memory the item occupies, and what types of operations can be performed on the data.

A

The Data Type

34
Q

Integers in the range of −128 to +127

A

byte
(1 byte)

35
Q

Integers in the range of −32,768 to +32,767

A

short
(2 byte)

36
Q

Integers in the range of −2,147,483,648 to +2,147,483,647

A

int
(4 byte)

37
Q

Integers (−9,223,372,036,854,775,808 to +9,223,372,036,854,775,807)

A

long
(8 byte)

38
Q

Floating-point numbers in the range of ±3.4 × 10−³⁸ to ±3.4 × 10³⁸, with 7 digits of accuracy

A

float
(4 byte)

39
Q

Floating-point numbers in the range of ±1.7 × 10−³⁰⁸ to ±1.7 × 10³⁰⁸, with 15 digits of accuracy

A

double
(8 byte)

40
Q

can hold single character only

A

char
(2 byte)

41
Q

can hold boolean value which is true or false

A

boolean
(1 bit)

42
Q

is a statement that reserves a named memory location

A

Variable Declaration

43
Q

It includes byte, short, int and long datatype.

A

The integer Data Types

44
Q

The floating-point numbers include fractional values and whole number.

A

The Floating-point Data Types

45
Q

is used to store characters.

A

The char Data Type

46
Q

can hold one character at a time.

A

The char Data Type

47
Q

Character literals are enclosed in single quotation marks.

A

The char Data Type

48
Q

Every character have an equivalent number based in ASCII code.

A

The char Data Type

49
Q

Characters are internally represented by numbers. Each printable character, as well as many non-printable characters, is assigned a unique number.

A

Unicode

50
Q

How many bytes does the Unicode require for memory?

A

two bytes

51
Q

lets you manually convert a value, even if it means that a narrowing conversion will take place.

A

Type Casting

52
Q

are unary operators that appear as a data type name enclosed in a set of parentheses.

A

Type Casting

53
Q

This line is known as a method header. It marks the beginning of a method.

A

public static void main(String[] args)

54
Q

Can be thought of as a group of one or more programming statements that collectively has a name.

A

Method

55
Q

When you declare a variable but do not assign a value to it.

A

Uninitialized Variable

56
Q

An uninitialized variable contains an unknown value called?

A

Garbage Value

57
Q

When the + operator is used with strings (“hello” + “world”) it is called the?

A

String Concatenation Operator

58
Q

Means to append

A

Concatenate

59
Q

When the + operator is used with two numbers as operand the + sign will be used as?

A

Operator Strings

60
Q

How many bytes and bits in one byte?

A

1 byte, 8 bits

61
Q

How many bytes in short?

A

2 bytes

62
Q

How many bytes in int?

A

4 bytes

63
Q

How many bytes in long?

A

8 bytes

64
Q

How many bytes in float?

A

4

65
Q

How many bytes in double?

A

8 bytes

66
Q

How many bytes in char?

A

2 bytes

67
Q

How many bits in boolean?

A

1 bit