What is the result of the expression 10 / 3 in Java?
A. 3.3333
B. 3
C. 3.1
D. 4
Answer: Option B
Solution (By Examveda Team)
In Java, both 10 and 3 are integer values.When an arithmetic operation is performed between two integers, Java uses integer division.
Integer division discards the fractional (decimal) part of the result instead of rounding it.
So, the expression 10 / 3 evaluates to 3, not 3.3333 or 3.1.
Join The Discussion
Comments (1)
Related Questions on Operators

This supposed to be dependent on the datatype, right? if the datatype is int yes, it is 3 but double and float will be different.