The modulus operator (%) in Java can be used only with variables of integer type.

  1. True

  2. False


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of the modulus operator (%) in Java.

The modulus operator (%) in Java calculates the remainder of dividing one number by another. It can be used with variables of integer type, but it can also be used with variables of floating-point types, such as float or double.

Therefore, the statement that the modulus operator (%) in Java can be used only with variables of integer type is incorrect.

Option A) True - This option is incorrect because the modulus operator (%) in Java can be used with variables of floating-point types as well. Option B) False - This option is correct because the modulus operator (%) in Java can be used with variables of both integer and floating-point types.

The correct answer is B) False. This option is correct because the modulus operator (%) in Java can be used with variables of integer and floating-point types.

Find more quizzes: