Какой из следующих вариантов кода выведет на экран "perform"?
(Ответ считается верным, если отмечены все правильные варианты ответов.)
Варианты ответа
public class SomeClass { void perform() { System.out.println("perform"); } private static SomeClass c = new SomeClass(); public static void main(String[] args) { c.perform(); } }(Верный ответ)
public class SomeClass { void perform() { System.out.println("perform"); } private SomeClass c; public static void main(String[] args) { SomeClass.perform(); } }
public class SomeClass { static void perform() { System.println("perform"); } private static SomeClass = new SomeClass(); public static void main(String[] args) { c.perform("perform"); } }
public class SomeClass { static void perform() { System.out.println("perform"); } private static SomeClass c; public static void main(String[] args) { SomeClass.c.perform(); } }(Верный ответ)