Which data type is used to represent integer values in Java?
A. int
B. float
C. boolean
D. char
Answer: Option A
Solution (By Examveda Team)
The correct answer is Option A: int.In Java, the int data type is used to represent integer values (whole numbers) without decimal points.
Here's the breakdown:
Option A: int - This is the correct data type for representing integer values in Java.
Option B: float - The float data type is used for representing numbers with decimal points, not integers.
Option C: boolean - The boolean data type is used to represent true or false values, not integers.
Option D: char - The char data type is used to represent single characters, not integers.
So, in Java, the data type used to represent integer values is int.
Join The Discussion