Examveda
Examveda

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.

This Question Belongs to Java Program >> Data Types And Variables

Join The Discussion

Related Questions on Data Types and Variables