get Getter Method from field name - Java Reflection

Java examples for Reflection:Field Get

Description

get Getter Method from field name

Demo Code


//package com.java2s;

public class Main {


    public static String getGetterMethod(String field) {
        String startLetter = field.substring(0, 1).toUpperCase();
        return "get" + startLetter + field.substring(1, field.length());
    }//from  w w w.j a v  a2 s.  c o  m
}

Related Tutorials