import java.io.*;
public class SwitchCase {
public static void main(String[] args) {
int i;
try {
BufferedReader in = new BufferedReader(
new FileReader("SwitchCase.java"));
BufferedWriter out = new BufferedWriter(
new FileWriter("output.txt"));
while((i = in.read()) != -1) {
if(i >= 'A' && i <= 'Z') i = (int)Character.toLowerCase((char)i); else if(i >= 'a' && i <= 'z')
i = (int)Character.toUpperCase((char)i);
out.write(i);
}
in.close();
out.close();
}
catch(IOException e) {
System.out.println("Got error.");
System.exit(1);
}
}
}
Tag: Study Code Program Java
No comments:
Post a Comment