Que 4.)

Which loop is used when the number of iterations is not known in advance?

  • for loop

  • while loop

  • do-while loop

  • nested loop

option_b

The while loop is useful when the number of iterations is unknown beforehand.

Que 5.)

What happens if the loop condition never becomes false in Java?

  • Syntax Error

  • Runtime Error

  • Infinite Loop

  • Compilation Error

option_c

If the condition never evaluates to false, the loop will run indefinitely.

Que 6.)

Which data type is used to store whole numbers in Java?

  • float

  • int

  • double

  • boolean

option_b

The `int` data type is used to store whole numbers in Java.