I\'m following the CS106A lectures online. I\'m going through the code on Lecture 12, but it\'s giving me errors in Eclipse.
This is my code. It seems the error is beca
You can't have nested method in java.
toLower() method is inside main().
separately use both method. void means there isn't any return from those method.
You can try as follows
public static void main(String[] args){
char output=new CS106A().toLower('a'); // calling toLower() and take the
// return value to output
}
public char toLower(char ch){
if (ch >= 'A' && ch <= 'Z'){
return ((ch - 'A') + 'a');
}
return ch;
}