Skip to content

Interview: Integer Pool-ы #242

Open
@aarexer

Description

Разбор задачи в interview/questions/beginner.
Имя файла: integer_pool.md

Условие:
Написать что выведет данный код при запуске, рассказать почему и можно ли сделать так, чтобы последняя проверка вернула true.

public class Test {
    public void test() {
        Integer obj1, obj2;

        obj1 = new Integer(100);
        obj2 = new Integer(100);
        assertFalse(obj1 == obj2);

        obj1 = 100;
        obj2 = 100;
        assertTrue(obj1 == obj2);

        obj1 = 200;
        obj2 = 200;
        assertFalse(obj1 == obj2);
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    interviewAbout interview tasks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions