Syntax, Logic, Runtime Errors in Java

preview_player
Показать описание
A description of three types of errors in Java programming.

Рекомендации по теме
Комментарии
Автор

Hi Brandan, can you help me figure out which three line of code to choose to satisfy these conditions? Here's the question:








You are creating a Java method

The method excepts a String parameter named text. It returns true if text meets any of the following conditions.

• Is null
• Contains only an empty string
• Contains only whitespace characters
Otherwise, the method returns false.

Code Segments Answer Area


If (text.isEmpty()) return true;


If (text == “ ”) return true;


return false;


If (text == null) return true;




If (text.trim()isEmpty()) return true;


return true;




I've tried to run three lines and can't figure this one out?




Thank you

darrylalexanderevanswebgra