Which of these lines when placed in line 1 will create an instance of class Inner? (select all that apply).

class Outer {
	public class Inner { }
	Inner getInner(){ return new Inner(); }
	public Outer() { }
}

public class Starter {
	public static void main(String[] args) {
		//1
	}
}
Explanation
Neither class Inner, nor method getInner() are static, therefore you need to have an instance of class Outer to create an instance of class Inner.

Следи за CodeGalaxy

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

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