For this Question: Given a number String S, Your task is to find the sum of the numbers.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>Sum()</b> that takes the String S as a parameter.

Constraints:-
1 <= |S| <= 1000

Note:- String will contain only numbers from 0-9.Return the sum of the string.Sample Input:-
123

Sample Output:-
6

Sample Input:-
123456789

Sample Output:-
45, 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();
	System.out.print(StringLength(s));
	
}
static int StringLength(String S){
    int n = S.length();
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=(int)S.charAt(i)-(int)'0';
    }
    return sum;
}


}
	    


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