For this Question: Given a string S (containing only letters of the English alphabet), find all the capital letters in it (in exactly same order as the string)

Note:- It is guaranteed that the given string will contain at least one capital.Input contains a single line containing the string S.

Constraints:-
1 <= |S| <= 100Print all capital letters present in the string separated by space, in the order of their appearance in the main string.Sample input:-
AbcdEF

Sample Output:-
A E F

Sample Input:-
NewtonSchool

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

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
	String s = sc.next();
	int n = s.length();
	for(int i=0;i<n;i++){
	    if(s.charAt(i)>='A' && s.charAt(i)<='Z'){
	        System.out.print(s.charAt(i)+" ");
	    }
	}
    
	

}
	    


}, In this Programming Language: Java, Now tell me if this Code is compilable or not?