Data Types Interview Questions
Data Types Interview Questions
Data Types Interview Questions
com
1
KODNEST PH:7411615623 hello@kodnest.com
13. What is the range of data that can be stored in byte data type?
(-128 to +127)
14. In what format is audio data stored in memory unit?
(.mp3 format)
15. What is the range of data that can be stored in short data type?
(-32768 to +32767)
16. How many bytes are allocated for char data type in Java? Why?
(2 bytes, because java follows UNICODE)
17. Is zero a positive number or negative number in programming?
Why?
(Zero is a positive number, because the most significant bit in the
positive number is zero)
18. Who initiates the process of executing a program?
(OS)
19. Why does Java provide primitive data types in spite of the fact
that it makes it only 99% OOP?
(Because primitive data types are fast in execution when
compared to wrapper classes)
20. What is the range of double?
(-1.7e-308 to +1.7e+308)
21. Why does Java provide four data types to manage Integer
type data?
(Because in real world integer data exists in varying magnitudes)
22. Why does Java provide two data types to manage real number
type data?
(for less precision and higher precision hint: double provides
more accuracy than float)
2
KODNEST PH:7411615623 hello@kodnest.com
3
KODNEST PH:7411615623 hello@kodnest.com
36. How many bytes are allocated for byte data type in Java?
(1 byte)
37. How many bytes are allocated for double data type in Java?
(8 bytes)
38. How many bytes are allocated for int data type in Java?
(4 bytes)
39. Which special characters may be used as the first character of
an identifier?
(_ and $)
40. Why is ASCII format forcefully stored as 8-bit format?
(Because minimum memory that is allocated is 1 Byte i.e. 8bits)
41. What is UTF?
(Universal Transactional Format)
42. What is meant by rounding towards zero in integer division?
(truncation, i.e. fractional portion is truncated and only the
integer portion is retained)
43. Are true and false keywords?
(yes)
44. What is numeric promotion?
(When data of a smaller magnitude is placed within a memory
location of a larger magnitude, it is called as numeric promotion.
Implicit typecasting is also called as numeric promotion.)
45. Give the implicit typecasting chart or numeric promotion
chart?
(Refer class notes)
4
KODNEST PH:7411615623 hello@kodnest.com
5
KODNEST PH:7411615623 hello@kodnest.com
6
KODNEST PH:7411615623 hello@kodnest.com
int x3 = 5_______3;
int x4 = 0_x53;
int x5 = 0x_53;
int x6 = 0x5_3;
int x7 = 0x53_;