So, I'm trying to make a program that reads args and transforms all letters in capital letters without the use of toUpperCase(). The only way I have to use to process the single letters is with " - 'a' + 'A' "
This is what I did so far
import java.util.Scanner;
public class ArgsTest{
public static void main(String args[]){
for(int i = 0; i<args.length; i++){
for(int y=0; y<args[i].length(); y++){
if ('a' <= args[i].charAt(y) && args[i].charAt(y) <= 'z') {
args[i].charAt(y) = (char)(args[i].charAt(y) - 'a' + 'A');}
}
}
}
}
I don't understand what I'm doing wrong, the error says:
ArgsTest.java:9: error: unexpected type
args[i].charAt(y) = (char)(args[i].charAt(y) - 'a' + 'A');
^
required: variable
found: value
1 error