This is what i got:
Expand|Select|Wrap|Line Numbers
- public class ChangeCase {
- public static void main (String args[]) {
- String tempString;
- char tempCharacter;
- char tempCharUp;
- char tempCharDown;
- for (int i=0 ; i < args.length ; i++){
- tempString = args[i];
- tempCharacter = tempString.charAt(i);
- tempCharUp = tempCharacter.toUpperCase();
- tempCharDown = tempCharacter.toLowerCase();
- if (tempCharacter.equals(tempCharUp)){
- tempCharacter = tempCharDown;
- System.out.println (tempCharacter);
- }
- else {
- tempCharacter = tempCharUp;
- System.out.println (tempCharacter);
- }
- }
- }
- }
ChangeCase.java:15: char cannot be dereferenced
tempCharUp = tempCharacter.toUpperCase();
^
ChangeCase.java:16: char cannot be dereferenced
tempCharDown = tempCharacter.toLowerCase();
^
ChangeCase.java:17: char cannot be dereferenced
if (tempCharacter.equals(tempCharUp)){
^
3 errors
Any sugestions please, im quite new to java.
Regards in advance.