What will be the result of compiling and running the following code:

public final class QTest {
    public static void main(String[] args) {
        new QTest() {
            public void show() {
    public void show() {
Compilation error will occur, because there is an attempt to instantinate an anonimous inner class, which is a subclass of final class QTest. (Classes declared with a final modifier can't have subclasses)

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Зарегистрируйся сейчас
или Подпишись на будущие тесты