For this Question: Given a string S and a char X, your task is to print the number of times the character X occurred in the string S.The input contains the string S and the character X separated by a space.

Constraints:-
1 <= |S| <= 100000
'a' <= S[i] <= 'z'
'a' <= X <= 'z'Print the number of times the character X occurred in the string S.Sample Input:-
newtonschool o

Sample Output:-
3, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException {


                BufferedReader br=new BufferedReader(
                    new InputStreamReader(System.in)
                );

                String[] st1=(br.readLine()).split(" ");
                String s=st1[0];
                String s_char=st1[1];
                char X=s_char.charAt(0);



                int cnt=0;

                for(int i=0;i<s.length();i++){
                        char ch=s.charAt(i);

                        if(ch == X){
                            cnt++;
                        }
                }
                    System.out.print(cnt);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?