What is Truncation in Java?

Java MCQ: What is Truncation in Java?

a) Removing decimal part from a number
b) Rounding off a number
c) Converting float to int
d) None of the above

Answer:

a) Removing decimal part from a number

Explanation:

Truncation in Java refers to the process of removing the fractional part (decimal part) from a number, effectively converting it to a lower precision type or simply to an integer.

Reference links:

https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top