Java | Tests
1.82K subscribers
1 photo
1 link
Проверь свои знания в Java

✍️По всем вопросам: @Pascal4eg
Download Telegram
Что выведет код? 👆
Anonymous Quiz
47%
50
12%
51
7%
0
34%
<Ошибка компиляции>
🎉2
public class Test {
public final int value = 4;
public void doIt() {
int value = 6;
Runnable r = new Runnable() {
public final int value = 8;
public void run() {
int value = 10;
System.out.println(this.value);
}
};
r.run();
}
public static void main(String[] args) {
new Test().doIt();
}
}
❤2
Что выведет код? 👆
Anonymous Quiz
23%
4
8%
6
43%
8
26%
10
❤2👍1🎉1
public class Test {
public static void main(String[] args) {
System.out.println(isEqual(1, 1));
}

private static boolean isEqual(int i, int j) {
return (i == j) ? null : false;
}
}
❤1🔥1
Что выведт код? 👆
Anonymous Quiz
11%
true
14%
false
40%
null
35%
<Ошибка NullPointerException>
🎉1
public class Test {
public static void main(String[] args) {
System.out.println(2 ^ 3);
}
}
❤1🔥1
Что выведет код? 👆
Anonymous Quiz
10%
0
30%
1
12%
5
17%
6
32%
<Ошибка компиляции>
🎉1
public class Test {
public static void main(String[] args) {
int i = 0;
System.out.println(--i++);
}
}
❤2🔥1
Что выведет код? 👆
Anonymous Quiz
47%
-1
23%
0
3%
1
27%
<Ошибка компиляции>
🌚4🎉1
public class Test {
public static void main(String[] args) {
System.out.println(true ^ true & false);
}
}
💯1
Что выведет код? 👆
Anonymous Quiz
36%
true
35%
false
29%
<Ошибка компиляции>
🎉1
class Test {

public static int VAL;

{
VAL = 5;
}

public Test() {
VAL = 10;
}

public static void print() {
System.out.println(VAL);
}

}

public class Quest {
public static void main(String[] args) {
Test.print();
}
}
❤2
Что выведет код? 👆
Anonymous Quiz
23%
0
38%
5
25%
10
14%
<Ошибка компиляции>
❤3👍2🎉1
public class Test {
public static void main(String[] args) {
int x = 1;
System.out.println("x+1 = " + x+1);
}
}
❤2💯1
Что выведет код? 👆
Anonymous Quiz
42%
x+1 = 2
41%
x+1 = 11
17%
<Ошибка компиляции>
❤2🎉2
public class Test {
public static void main(String[] args) {
int i = 0;
method(i);
System.out.print(i);

StringBuilder sb = new StringBuilder();
sb.append("1");
method2(sb);
System.out.print(sb);
}

public static void method(int val) {
val = 1;
}

public static void method2(StringBuilder sb) {
sb.append("2");
sb = new StringBuilder();
sb.append("3");
}
}
❤1💯1
Что выведет код? 👆
Anonymous Quiz
19%
13
25%
012
10%
112
19%
0123
27%
03
❤2🔥1🎉1
public class Test {
public static void main(String[] args) {
System.out.println(cond(1) && cond(2));
}

private static boolean cond(int i) {
try {
return false;
} finally {
System.out.print(i);
}
}
}
❤1
Что выведет код? 👆
Anonymous Quiz
17%
12false
41%
1false
28%
false12
14%
false1
🎉2❤1
public class Test {
public static void main(String[] args) {
String s = null;
if (s != null & s.length() > 0) {
System.out.println("FULL");
} else {
System.out.println("EMPTY");
}
}
}