Introduction to Java Programming Flashcards

(67 cards)

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
Some examples are, dividing by zero error, insufficient memory for dynamic memory allocation, referencing out-of-range array element.
Runtime error
26
These are not detected by com-piler while compilation process.
Runtime error
27
The most difficult type of errors to track down.
Logical error
28
They occur when you make a mistake in the logic that drives your program and you do not get the result you expected.
Logical error
29
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
Logical error
30
It is a programmer-defined name that represents some element of a program
Identifiers
31
Examples of Identifiers
Variable names and class names
32
Beginning an identifier with a lowercase letter and capitalizing subsequent words within the identifier is a style known as ____?
Camel Casing
33
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.
The Data Type
34
Integers in the range of −128 to +127
byte (1 byte)
35
Integers in the range of −32,768 to +32,767
short (2 byte)
36
Integers in the range of −2,147,483,648 to +2,147,483,647
int (4 byte)
37
Integers (−9,223,372,036,854,775,808 to +9,223,372,036,854,775,807)
long (8 byte)
38
Floating-point numbers in the range of ±3.4 × 10−³⁸ to ±3.4 × 10³⁸, with 7 digits of accuracy
float (4 byte)
39
Floating-point numbers in the range of ±1.7 × 10−³⁰⁸ to ±1.7 × 10³⁰⁸, with 15 digits of accuracy
double (8 byte)
40
can hold single character only
char (2 byte)
41
can hold boolean value which is true or false
boolean (1 bit)
42
is a statement that reserves a named memory location
Variable Declaration
43
It includes byte, short, int and long datatype.
The integer Data Types
44
The floating-point numbers include fractional values and whole number.
The Floating-point Data Types
45
is used to store characters.
The char Data Type
46
can hold one character at a time.
The char Data Type
47
Character literals are enclosed in single quotation marks.
The char Data Type
48
Every character have an equivalent number based in ASCII code.
The char Data Type
49
Characters are internally represented by numbers. Each printable character, as well as many non-printable characters, is assigned a unique number.
Unicode
50
How many bytes does the Unicode require for memory?
two bytes
51
lets you manually convert a value, even if it means that a narrowing conversion will take place.
Type Casting
52
are unary operators that appear as a data type name enclosed in a set of parentheses.
Type Casting
53
This line is known as a method header. It marks the beginning of a method.
public static void main(String[] args)
54
Can be thought of as a group of one or more programming statements that collectively has a name.
Method
55
When you declare a variable but do not assign a value to it.
Uninitialized Variable
56
An uninitialized variable contains an unknown value called?
Garbage Value
57
When the + operator is used with strings ("hello" + "world") it is called the?
String Concatenation Operator
58
Means to append
Concatenate
59
When the + operator is used with two numbers as operand the + sign will be used as?
Operator Strings
60
How many bytes and bits in one byte?
1 byte, 8 bits
61
How many bytes in short?
2 bytes
62
How many bytes in int?
4 bytes
63
How many bytes in long?
8 bytes
64
How many bytes in float?
4
65
How many bytes in double?
8 bytes
66
How many bytes in char?
2 bytes
67
How many bits in boolean?
1 bit