"This method must return a result of type String"
in
Programming Questions
•
2 years ago
Ok guys and gals here is the code :
private String lookStyle() {
switch (lookStyle) {
case 0 : return "Fluid size"; break;
case 1 : return "Fixed size"; break;
case 2 : return "Cells"; break;
}
}
Compiler says "This method must return a result of type String" so I tried this :
private String lookStyle() {
switch (lookStyle) {
case 0 : return "Fluid size"; break;
case 1 : return "Fixed size"; break;
case 2 : return "Cells"; break;
default : return ""; break;
}
}
Now the compiler says "Unreachable code"
Whats up???
Thanks!!
1