- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
💻 Java String Puzzle | 90% Get This Wrong! 😱 #shots #java
💻 Daily JAVA Challenge | Problem #28
#sh
Can you guess the output of this tricky Java question? 🤔
This one tests your understanding of the String Constant Pool and the difference between "==" and ".equals()".
👇 Code:
public class Test {
public static void main(String[] args) {
String s1 = "Java";
String s2 = "Ja" + "va";
System.out.println(s1 == s2);
}
}
🔘 Options:
A) true
B) false
C) Compilation Error
D) Runtime Error
✅ Correct Answer: A) true
💡 Explanation:
The expression ""Ja" + "va"" is resolved at compile time, so it becomes ""Java"". Both "s1" and "s2" point to the same object in the String Constant Pool. Hence, "==" returns true because it compares references.
🔥 Important Concept:
- "==" → compares memory reference
- ".equals()" → compares actual content
👍 If you found this helpful, like, share, and subscribe for more daily Java challenges!
#java #javaprogramming #coding #programming #javachallenge #code #developers #learnjava #codinglife #softwaredeveloper #tech #shorts #youtubeshorts #viral #trending
#shorts
Видео 💻 Java String Puzzle | 90% Get This Wrong! 😱 #shots #java канала CodeCraft Pro
#sh
Can you guess the output of this tricky Java question? 🤔
This one tests your understanding of the String Constant Pool and the difference between "==" and ".equals()".
👇 Code:
public class Test {
public static void main(String[] args) {
String s1 = "Java";
String s2 = "Ja" + "va";
System.out.println(s1 == s2);
}
}
🔘 Options:
A) true
B) false
C) Compilation Error
D) Runtime Error
✅ Correct Answer: A) true
💡 Explanation:
The expression ""Ja" + "va"" is resolved at compile time, so it becomes ""Java"". Both "s1" and "s2" point to the same object in the String Constant Pool. Hence, "==" returns true because it compares references.
🔥 Important Concept:
- "==" → compares memory reference
- ".equals()" → compares actual content
👍 If you found this helpful, like, share, and subscribe for more daily Java challenges!
#java #javaprogramming #coding #programming #javachallenge #code #developers #learnjava #codinglife #softwaredeveloper #tech #shorts #youtubeshorts #viral #trending
#shorts
Видео 💻 Java String Puzzle | 90% Get This Wrong! 😱 #shots #java канала CodeCraft Pro
Комментарии отсутствуют
Информация о видео
5 мая 2026 г. 18:31:04
00:00:11
Другие видео канала





















