Java
Select all ...
Мова сайту: Українська
Українська
English
Русский
Тести з програмування
Вхід
Реєстрація
Тести з програмування
Теорія
Сніпети
Статті
Головна
Android
Ціни
FAQ
Історія Cosmo
Правила та умови сервісу
Політика конфіденційності
Політика щодо файлів cookie
Зворотній Зв’язок
Select all the valid signatures of some class Clazz constructors.
Clazz(String name)
Clazz Clazz(String name)
int Clazz(String name)
void Clazz(String name)
Clazz(name)
Clazz()
Explanation
Constructors can not return a value, even void
constructors
1
(1)
Подобається
Ввійдіть
щоб вподобати
Комментувати
Ввійдіть
щоб прокоментувати
Поширити
Tweet
Пов'язані матеріали
What will be the result of the following code compilation and execution? public class Test { final String s; public Test() { s = "default"; } public Test(String s) { } public static void main(String[] args) { System.out.println(new Test().s); } }
What will be the result of the following program execution? public class MyThread extends Thread { public void run() { System.out.println("I'm Running!"); } public static void main(String[] args) { System.out.println("About to run thread"); new MyThread("Run, Thread, Run!").start(); } }
What will be the following program's output? package tutorial.base; public class TypesTutorial { public static void main(String... args) { A alpha = new B(); } } class A { A() { System.out.print("A"); a(); } void a() { System.out.print("a"); } } class B extends A { B() { System.out.print("B"); a(); } void a() { System.out.print("b"); } }
What is the following program`s execution result? class Tack { static short s = 17; public Tack(short ss) { new Tack(); s *= ss; } public Tack() { ; } } public class Bridle extends Tack { public Bridle(int s) { System.out.println(s + 1); } public static void main(String[] args) { Bridle b = new Bridle(3); } }
What will be the result of compiling and running the following code: import java.util.List; import java.util.ArrayList; public class Test { public static void main(String[] args) { List<String> values = new ArrayList<String>() { { add("one"); add("two"); add("three"); } }; System.out.print("values: "); for (String value : values) { System.out.print(value + " "); } } }
Which of the following statements in the given code are true? class A { A(int i) {} } // 1 class B extends A {} // 2
Тести з
J
ava
Приєднуйся і вивчай Java
або
Дізнайся більше про
Тести з Java онлайн
Слідкуй за CodeGalaxy
Мобільний додаток Beta
Зворотній Зв’язок
Продовжуйте вивчати
тести з Java
What will be printed out as a result of the following code execution / compilation? class A { public A() { System.out.print("A"); } } class B { public B() { System.out.print("B"); } } class C { public C() { System.out.print("C"); } } public class D extends C { private A objA = new A(); private static B objB = new B(); public D() { System.out.print("D"); } public static void main(String[] args){ new D(); } }
What will be printed out as a result of the following code execution / compilation? public class Test { private String name; Test(String name) { this.name = name; } public void test(final Test test) { test = new Test("three"); } public String toString() { return name; } public static void main(String[] args) { Test t1 = new Test("one"); Test t2 = new Test("two"); t1.test(t2); System.out.println(t2); } }
What will be printed out as a result of the following code execution / compilation? public class Test { static void m(int ... a) { System.out.println("1"); } static void m(Integer ... a) { System.out.println("2"); } public static void main(String[] args) { m(1, 2); } }
What will be printed out as a result of the following code execution / compilation? public class Test { public static void main(String[] args) { ElectricInverter inverter = new ElectricInverter(); int AC = 220; System.out.println(inverter.invert(AC)); } } class ElectricInverter { public static final int AC = ~220; public static final int DC = -110; public static final int GROUND = 0; int invert(int type) { if (type == AC) { return DC; } else if (type == DC) { return AC; } return GROUND; } }
int i = Integer.MAX_VALUE + 10; What is the result of the given line execution?
What happens after the following code is compiled and run: 01: interface TheInterface { 02: void print(); 03: } 04: 05: class TheClass implements TheInterface { 06: public void print() { 07: System.out.println("TheClass"); 08: } 09: } 10: 11: public class ClassConversion { 12: public static void main(String[] args) { 13: TheClass c = new TheClass(); 14: TheInterface i = c; 15: i.print(); 16: } 17: }
Зареєструйся Зараз
або
Підпишись на майбутні тести
Ввійдіть щоб вподобати
Ввійдіть щоб прокоментувати