🎉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");
}
}
}Что выведет код? 👆
Anonymous Quiz
9%
FULL
37%
EMPTY
6%
<Ошибка компиляции>
49%
<Ошибка NullPointerException>
❤4🥰1
public class ShadesOfGray {
public static void main(String[] args) {
System.out.println(X.Y.Z);
}
}
class X {
static class Y {
static String Z = "BLACK";
}
static C Y = new C();
}
class C {
String Z = "WHITE";
}❤1
✍3🎉1
public class Test {
public static void main(String[] args) {
System.out.println(calc());
}
static int calc() {
try {
if (1 == 1)
throw new RuntimeException();
return 1;
} catch (Exception e) {
return 2;
} finally {
return 3;
}
}
}❤1
❤2👍1🎉1
public class Test {
public static void main(String[] args) {
System.out.print(and1() && and2() && and3());
}
private static boolean and1() {
System.out.print(1);
return false;
}
private static boolean and2() {
System.out.print(2);
return true;
}
private static boolean and3() {
System.out.print(3);
return false;
}
}❤1
🎉2❤1
public class Test {
public static void main(String[] args) {
System.out.println(5 + true);
}
}❤1
🎉2
public class Test {
public static void main(String[] args) {
System.out.println("5" + true);
}
}❤2
❤2👎1🎉1
public class Test {
public static void main(String[] args) {
boolean f = false;
System.out.println(f = f ^ true);
}
}❤3
✍1🎉1
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);
}
}❤2
🎉2❤1
public class Test {
public static void main(String[] args) {
System.out.println(true &! false);
}
}❤1
🤡3❤2👍2🎉1💯1
public class Test {
public static void main(String[] args) {
boolean b = false;
System.out.println(b++);
}
}❤1