Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Null Reference Handling | Reference Types and Strings
Java Data Types

bookChallenge: Null Reference Handling

Завдання

Swipe to start coding

Write a method to safely check if a string is null or empty, and return a suitable message for each case.

  • If the string is null, return: Input is null.
  • If the string is empty, return: Input is empty.
  • If the string contains text, return: Input is: <value> (replace <value> with the actual string value).

Call this method from the main method with at least one example of each case, and print the returned result.

Рішення

solution.java

solution.java

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 5
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

Awesome!

Completion rate improved to 7.14

bookChallenge: Null Reference Handling

Свайпніть щоб показати меню

Завдання

Swipe to start coding

Write a method to safely check if a string is null or empty, and return a suitable message for each case.

  • If the string is null, return: Input is null.
  • If the string is empty, return: Input is empty.
  • If the string contains text, return: Input is: <value> (replace <value> with the actual string value).

Call this method from the main method with at least one example of each case, and print the returned result.

Рішення

solution.java

solution.java

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 5
single

single

some-alt