How to Convert Float to Int in Java


Choose an answer and hit 'next'. You will receive your score and answers at the end.

question 1 of 3

Which of the following correctly uses auto-boxing to convert a float to an int?

Create Your Account To Take This Quiz

As a member, you'll also get unlimited access to over 79,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.

Try it risk-free
Try it risk-free for 30 days. Cancel anytime
Already registered? Log in here for access

1. Examine the following code. What will the value of the variable conv be if the float variable fvalue has a value of 13.26?

2. Which of the following casts the variable g to an integer value?

Create your account to access this entire worksheet
A Premium account gives you access to all lesson, practice exams, quizzes & worksheets
Access to all video lessons
Quizzes, practice exams & worksheets
Certificate of Completion
Access to instructors
Create an account to get started Create Account

About This Quiz and Worksheet

For this quiz and worksheet, you can review how to convert variables as floats into variables as ints. Questions address the use of auto-boxing to convert, as well as the type of class that describes Float.

Quiz and Worksheet Goals

Your understanding of the conversion process is tested with questions about these topics:

  • The value of a variable conv with an existing value inside another variable
  • A code selection that converts a variable into an int
  • The type of conversion happening to a given code
  • Describing Float as a type of class

Skills Practiced

  • Information recall - remember what you have learned about auto-boxing
  • Defining key concepts - ensure that you can accurately describe Float as a type of Java class
  • Problem solving - use what you know to solve a practice problem involving conversion from one variable to another

Additional Learning

To find out more, head over to the lesson titled How to Convert Float to Int in Java. With this, you can delve into the material listed below:

  • Math.round method
  • Visual representations of auto-boxing
  • Comparing types of variables