I have to write a program to input a String str and change the upper case to lower case and vice versa. For example:
input: "abCD"
output: "ABcd"
this is what I've got:
l-is the length of the string
for(int b=0;b < l;b++)
{
char let=str.charAt(b);
if(let>97 && let<122)
{char nlet=let-32;
System.out.print(nlet);
}
else if(let>65 && let<90)
{ char t=let+32;
System.out.print(t);
}
}
break;
}
the error coming for this line:"char nlet=let-32;
" is:
required:char;found:int;
how do i fix this?