I'm not sure why my second for loop doesn't convert the characters in my character array to UpperCase.
package com.codegym.task.task08.task0823;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Going national
*/
public class Solution {
public static void main(String[] args) throws IOException, NullPointerException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String a = reader.readLine();
Character[] cArr = new Character[20];
for (int i = 0; i < a.length(); i++) { //Converts String from keyboard to char Array
char stringChar = a.charAt(i);
cArr[i] = stringChar;
}
for (int i = 1; i < a.length(); i++) {
if ((cArr[i]<=1) || (cArr[i-1]).equals("null")) {
cArr[i] = Character.toUpperCase(cArr[i]); //Converts every letter with a space before it in the string to Uppercase
}
}
for(int i = 0; i< a.length(); i++){ //Prints out every letter in the String on the same line
System.out.print(cArr[i]);
}
}
}