Java | Tests


Channel's geo and language: Russia, Russian
Category: Technologies


Проверь свои знания в Java
✍️По всем вопросам: @Pascal4eg

Related channels

Channel's geo and language
Russia, Russian
Statistics
Posts filter


Что выведет код? 👆
Poll
  •   TO BE
  •   NOT TO BE
  •  
27 votes


class A {
static class B {
static String C = "NOT TO BE";
}
static Z B = new Z();
}

class Z {
String C = "TO BE";
}

public class Test {
public static void main(String[] args) {
System.out.println(A.B.C);
}
}


Что выведет код? 👆
Poll
  •   Woof Woof
  •   Woof
  •  
11 votes


class Dog {
public static void bark() {
System.out.print("Woof ");
}
}

class Basenji extends Dog {
public static void bark() { }
}

public class Bark {
public static void main(String[] args) {
Dog woofer = new Dog();
Dog nipper = new Basenji();
woofer.bark();
nipper.bark();
}
}


Что выведет код? 👆
Poll
  •  
  •   1
  •  
53 votes


public class Test {
{
System.out.println(i);
}
int i;

public Test(int i){
this.i = i;
}

public static void main(String[] args) {
new Test(1);
}
}


Что выведет код? 👆
Poll
  •   1
  •   2
  •  
44 votes


public class Test {

public static void main(String[] args) {
System.out.println(condition(null) ? 1 : 2);
}

public static boolean condition(Number o) {
return true;
}

public static boolean condition(Long l) {
return false;
}

}


Что выведет код? 👆
Poll
  •   one two three
  •   one one two
  •   one one one
  •  
10 votes


class One {
public static void go() {
System.out.print("one ");
}
}

class Two extends One {
public static void go() {
System.out.print("two ");
}
}

class Three extends Two {
public static void go() {
System.out.print("three ");
}
}

public class Test {
public static void main(String[] args) {
One one = new One();
one.go();

One two = new Two();
two.go();

Two two2 = new Three();
two2.go();
}
}


Что выведет код? 👆
Poll
  •   false
  •   true
  •   1
  •  
15 votes


public class Test {
public static void main(String[] args) {
boolean b = false;
System.out.println(b++);
}
}


Что выведет код? 👆
Poll
  •   true
  •   false
  •  
7 votes


public class Test {
public static void main(String[] args) {
System.out.println(true &! false);
}
}


Что выведет код? 👆
Poll
  •  
  •   1
  •   10
  •  
38 votes


class Person {
public static int idGenerator = 0;
private int id;

public Person() {
this.id = idGenerator++;
}
}

public class Test {
public static void main(String[] args) {
Person[] arr = new Person[10];
System.out.println(Person.idGenerator);
}
}


Что выведет код? 👆
Poll
  •   false
  •   true
  •  
19 votes


public class Test {
public static void main(String[] args) {
boolean f = false;
System.out.println(f = f ^ true);
}
}


Что выведет код? 👆
Poll
  •   5
  •   51
  •   5true
  •  
30 votes


public class Test {
public static void main(String[] args) {
System.out.println("5" + true);
}
}

20 last posts shown.