public class Test {
public static void main(String[] args) {
boolean b = false;
System.out.println(b++);
}
}❤1
❤2🎉1
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();
}
}❤2
Что выведет код? 👆
Anonymous Quiz
47%
one two three
35%
one one two
14%
one one one
4%
<Ошибка компиляции>
❤3
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;
}
}❤1
❤1🎉1
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);
}
}❤1
❤2🎉1
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();
}
}❤1
🔥1🎉1
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);
}
}❤1
🎉1
public class Test {
public static void main(String[] args) {
System.out.print(condition1() && condition2());
}
private static boolean condition1() {
System.out.print(1);
return false;
}
private static boolean condition2() {
System.out.print(2);
return true;
}
}❤1
❤2🎉1
public class Test {
public static void main(String[] args) {
int i=0;
label1: System.out.print(i++);
if (i < 2) {
goto label1;
}
}
}🔥2❤1
👏1🎉1
import java.util.HashSet;
import java.util.Set;
public class Test {
public static void main(String[] args) {
String str1 = "Hello World";
String str2 = new String("Hello World");
Set<String> set = new HashSet<>();
set.add(str1);
set.add(str2);
for (String str : set) {
if (str == str1) {
System.out.print("origin ");
}
if (str == str2) {
System.out.print("replace ");
}
}
}
}
❤1
✍1🎉1
🧠 Прокачай мозг с NonoQuest! 🧩
Хочешь не просто убивать время, а тренировать мышление? Попробуй NonoQuest — увлекательные японские кроссворды (нонограммы), где логика превращается в яркие пиксельные картинки! 🎨
✨ Тренируй логику и внимание
🔍 Развивай концентрацию
💡 Поддерживай умственную активность
Регулярные интеллектуальные занятия полезны для когнитивного здоровья.
🎮 NonoQuest — устрой мозгу полезную разминку!
📱 Игра для Android. Попробуй разгадать свою первую головоломку!
Хочешь не просто убивать время, а тренировать мышление? Попробуй NonoQuest — увлекательные японские кроссворды (нонограммы), где логика превращается в яркие пиксельные картинки! 🎨
✨ Тренируй логику и внимание
🔍 Развивай концентрацию
💡 Поддерживай умственную активность
Регулярные интеллектуальные занятия полезны для когнитивного здоровья.
🎮 NonoQuest — устрой мозгу полезную разминку!
Please open Telegram to view this post
VIEW IN TELEGRAM
❤3👍1🔥1
public class Test {
public static void main(String[] args) {
System.out.println(10 + 20 + "30");
}
}❤1
🎉1