calc Getter Name Bool for reflection - Java Reflection

Java examples for Reflection:Java Bean

Description

calc Getter Name Bool for reflection

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        String fieldName = "java2s.com";
        System.out.println(calcGetterNameBool(fieldName));
    }/*w w w. j  ava2s  .  c  om*/

    public static String calcGetterNameBool(String fieldName) {
        return "is" + ucfirst(fieldName);
    }

    public static String ucfirst(String str) {
        return Character.toUpperCase(str.charAt(0)) + str.substring(1);
    }
}

Related Tutorials