mcq Flashcards

1
Q

What is the default value of a variable declared boolean?
A TRUE

B FALSE

C null

D 1

A

b

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

An expression include byte, int, and numbers is moved up to which of these?
A int

B long

C byte

D float

A

a

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

In Java int, short, byte and long all of these are _________
A unsigned

B signed

C Both of the above

D None of these

A

b

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

Which data type(s) can store 64 bit Value?
A boolean

B int

C long

D float

A

c

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

Scope of Byte Data Type is ______.
A -128 to 128

B -127 to 127

C -127 to 128

D -128 to 127

A

d

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

. float is represented with ______ and double is represented with ______.
A 32 and 64

B 64 and 64

C 32 and 32

D 64 and 32

A

a

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

Which automatic type conversion is feasible?
A long to int

B int to long

C byte to int

D short to int

A

b,c,d

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

whiche of these can not be used for a variable name in java

A

keyword

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

litereal can be of these
boolean
integers
float

A

all of the mentioned

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

which one is valid decleration

A

boolean b3 =false;

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

in java the word true is

A

boolean literial

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

Multiple variables with different data types can be declared in a single statement.
True

False

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. The equal sign operator is used to assign a new value to a variable.

True

I
False

A

true

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

. Values represented by the double data type are referred to as floating point.

True

False

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. If a value could possibly have a decimal portion, int is the best data type choice.

True

False

HIDE ANSWER

A

false

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

An abstract data type is also called a primitive data type.

True

False

HIDE ANSWER

A

false

17
Q

Modulus division truncates the decimal portion of the quotient to result in an integer.

True

False

A

false

18
Q

Real division returns the entire quotient, including the decimal portion.
Correct True
True

Incorrect False
False

HIDE ANSWER

English
Real division returns the entire quotient, including the decimal portion.

A

true

19
Q
  1. A run-time error halts program execution at the statement that cannot be executed.

True

False

A

true

20
Q

Which is a valid identifier?
$12

void

55

diameter

A

diameter

21
Q

. How many values can a variable store at one time?

1

2

5

10

A

1

22
Q

Which data type declares a variable that stores a positive or negative whole number?
int

double

char

boolean

A

int

23
Q

Which data type is most appropriate for an employee’s salary?
int

double

char

boolean

A

double