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

✍️По всем вопросам: @Pascal4eg
Download Telegram
public class Main {
public static void main(String[] args) {
int[] arr = {1, 2, 3};
System.out.println(arr[3]);
}
}
👍2
🥱3🎉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");
}
}
}
👍2
👍4🎉1
import java.io.IOException;

public class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World");
} catch (IOException e) {
System.out.println("Error");
}
}
}
👍1
Что выведет код? 👆
Anonymous Quiz
77%
Hello World
7%
Error
16%
<Ошибка компиляции>
🤪11🎉2👍1🔥1
public class Test {

public static void main(String[] args) {
System.out.print(or1() || or2() || or3());
}

private static boolean or1() {
System.out.print(1);
return false;
}

private static boolean or2() {
System.out.print(2);
return true;
}

private static boolean or3() {
System.out.print(3);
return false;
}

}
👍1
Что выведет код? 👆
Anonymous Quiz
24%
1false
43%
12true
18%
123true
15%
123false
✍2❤2🎉2
public class Main {
public static void main(String[] args) {
int a = 10;
int b = 3;
System.out.println(a % b);
}
}
❤1
Что выведет код? 👆
Anonymous Quiz
66%
1
27%
3
5%
0
2%
<Ошибка компиляции>
🎉3
public class Main {
public static void main(String[] args) {
Object o = null;
System.out.println(o.toString());
}
}
❤1
🎉2
public class Main {
public static void main(String[] args) {
System.out.println(true ^ false);
System.out.println(true ^ true);
}
}
❤2
Что выведет код? 👆
Anonymous Quiz
35%
true false
37%
false true
24%
true true
4%
false false
👍3❤1🎉1
public class Main {
public static void main(String[] args) {
String s = String.valueOf((Object) null);
System.out.println(s);
}
}
❤2
✍4🎉1
public class Test {
public static void main(String[] args) {
double d = 5.0 / 0;
System.out.println(d);
}
}
👍1🔥1
👍4❤1🎉1
public class Test {
public static void main(String[] args) throws Exception {
String s = "programming";
System.out.println(s.substring(3, 6));
}
}
👍2
Что выведет код? 👆
Anonymous Quiz
6%
ogra
5%
ogr
8%
ogramm
30%
gram
44%
gra
7%
grammi
✍5🎉1