In line 19 return null is the only option i think there is if i need to only return a non-empty string.
Or skip that return statement completely but then how should I avoid this error "Solution.java:19: error: missing return statement".
Something like this,
public static class Idea {
public String s;
public String getDescription() {
if(!((s.equals(null)) && (s.equals("")))) {
return s;
}
//return ? or how to skip this error "Solution.java:19: error: missing return statement"
}
}
The actual code below...Thankspackage com.codegym.task.task06.task0617;
/*
Notepad for new ideas
*/
public class Solution {
public static void main(String[] args) {
printIdea(new Idea());
}
public static class Idea {
public String s = "";
public String getDescription() {
if(!((s.equals(null)) && (s.equals("")))) {
return s;
}
return null;
}
}
public static void printIdea(Idea idea) {
System.out.println(idea.getDescription());
}
}