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  av a 2 s  .  c o m

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

Related Exercise