Квиз по Java: Operators & Integer Division

This Java operators quiz focuses on the results that surprise beginners, above all integer division. You will predict output with /, %, ++, compound assignment and string concatenation, and see why && can protect you from an exception.

Лёгкий 10 вопроса ~5 минуты Проходной балл: 80% Java 17

Выберите режим

Вы играете как гость: войдите, чтобы сохранить XP и серию.

Пример вопроса

Вопрос 1 из 10

What does this print?

public class Main {
    public static void main(String[] args) {
        System.out.println(7 / 2);
    }
}
Показать ответ

B. 3 Both operands are int, so Java does integer division and drops the fraction (it does not round). The result is the int 3.

Что проверяет этот квиз

  • Integer division vs floating-point division
  • The remainder operator % with negative numbers
  • Dividing by zero with int and with double
  • Prefix and postfix ++
  • Short-circuit && and + with strings

Частые вопросы

Нужен ли аккаунт?

Нет. Играть может любой. Войдите, чтобы сохранять XP, серию, значки и историю.

Можно пройти ещё раз?

Да. Лучший результат сохраняется, а вопросы и ответы каждый раз перемешиваются.