Java - Write code to create function and check if a string starts With Upper Case

Requirements

Write code to create function and check if a string starts With Upper Case

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String text = "book2s.com";
        System.out.println(startsWithUpperCase(text));
    }//from   w w  w  . j  ava  2s  .c  om

    public static boolean startsWithUpperCase(String text) {
        return Character.isUpperCase(text.charAt(0));
    }
}