mcq Flashcards
What is the default value of a variable declared boolean?
A TRUE
B FALSE
C null
D 1
b
An expression include byte, int, and numbers is moved up to which of these?
A int
B long
C byte
D float
a
In Java int, short, byte and long all of these are _________
A unsigned
B signed
C Both of the above
D None of these
b
Which data type(s) can store 64 bit Value?
A boolean
B int
C long
D float
c
Scope of Byte Data Type is ______.
A -128 to 128
B -127 to 127
C -127 to 128
D -128 to 127
d
. 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
Which automatic type conversion is feasible?
A long to int
B int to long
C byte to int
D short to int
b,c,d
whiche of these can not be used for a variable name in java
keyword
litereal can be of these
boolean
integers
float
all of the mentioned
which one is valid decleration
boolean b3 =false;
in java the word true is
boolean literial
Multiple variables with different data types can be declared in a single statement.
True
False
false
- The equal sign operator is used to assign a new value to a variable.
True
I
False
true
. Values represented by the double data type are referred to as floating point.
True
False
true
- If a value could possibly have a decimal portion, int is the best data type choice.
True
False
HIDE ANSWER
false
An abstract data type is also called a primitive data type.
True
False
HIDE ANSWER
false
Modulus division truncates the decimal portion of the quotient to result in an integer.
True
False
false
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.
true
- A run-time error halts program execution at the statement that cannot be executed.
True
False
true
Which is a valid identifier?
$12
void
55
diameter
diameter
. How many values can a variable store at one time?
1
2
5
10
1
Which data type declares a variable that stores a positive or negative whole number?
int
double
char
boolean
int
Which data type is most appropriate for an employee’s salary?
int
double
char
boolean
double