1) What does a Data Type in Java refers to?
A) The place where data is stored
B) The technique how data is retreived
C) The type or variety of data being handled for reading and writing
Explanation:
Integers, Real numbers, Boolean, Characters etc
2) Choose the wrong statement about Java programming?
A) Java supports unsigned integers
B) Java supports signed integers
C) Java supports signed char
Explanation:
Only C language supports unsigned integers. Java does not support.
3) Which data type among the following is an implementation of Objects or OOPs?
A) byte
Explanation:
All primitive data types are implemented in a Non-Object Oriented way.
4) What is a Primitive Data Type in Java?
A) Data type, which is implemented in an Object-oriented way.
B) Data Type which is implemented in a machine-dependent way
C) Data Type which is implemented in a non-object oriented way.
5) which among the following is not a Data Type in Java?
A) short
Explanation:
"long double" is present only in C language.
6) Which among the following is not a valid Data Type in Java?
A) long
Explanation:
It is "boolean" not "bool".
7) Which is the data type used mostly to handle streams and buffers in Java language?
A) short
8) Which is the data type that is not recommended for numeric applications in Java?
A) byte
Explanation:
Size of a byte is only 8 bits. Also, any arithmetic operation produces output in int, float or double. It cannot handle more data.
9) Choose the number range for byte data type in Java?
A) -127 to +128
10) What is the size of a SHORT integer in Java?
A) 1 byte
Explanation:
Number range is -32768 and +32767.
11) What is the size of an INT integer in Java?
A) 2 bytes
Explanation:
Number range is -2147483648 and 2147483647.
12) What is the size of a LONG integer in Java?
A) 2 bytes
Explanation:
Range: -9223372036854775808 and 9223372036854775807.
13) What is the size of a FLOAT floating point number in Java?
A) 2 bytes
Explanation:
Number range is ±3.40282347E+38F
14) What is the size of a DOUBLE floating point number in Java?
A) 4 bytes
Explanation:
Number range is ±1.79769313486231570E+308.
15) What is the size of a CHAR data type constant in Java?
A) 1 byte
16) What is the size of a boolean data type constant in Java?
A) 1 bit
Explanation:
A boolean value can hold only one bit of information. But the size of a boolean constant in memory is not defined clearly anywhere. It is machine dependent. It may be 4 bytes or so.
17) What is the IEEE standard adopted to represent Floating point numbers in Java?
A) IEEE 9000
Explanation:
IEEE stands for Institute of Electrical and Electronics Engineers. Original specifications were defined in the year 1985. The current version includes improvements or corrections done in the year 2008.
18) What is the character encoding standard used in Java language?
A) ASCII
Explanation:
Unicode takes 2 Bytes of memory to represent all characters of all languages.
19) What is the abbreviation of ASCII?
A) American Standard Characters for Information Interchange
B) Australian Standard Code for Information Interchange
C) American Standard Code for Information Interchange
Explanation:
ASCII can represent only the English Alphabets and a few special symbols.
20) Choose the right statement about Java Data types.
A) Integer data types are short, int and long
B) Real number data types are float and double
C) The character data type is char.