Challenge: 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.
Oplossing
solution.java
Bedankt voor je feedback!
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me an example?
Awesome!
Completion rate improved to 7.14
Challenge: Null Reference Handling
Veeg om het menu te tonen
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.
Oplossing
solution.java
Bedankt voor je feedback!
single