Rajeev roushan sharma wrote:Hi All, I have seen code like String.class is passed to method where mether parameter is string type, like welcomeMsg(String fname, String lname). Istead of passing String type object how can we pass String.class?
Thanks in advance!
If the formal parameter type is java.lang.String then the actual parameter type can't be of java.lang.Class<String>.
Maybe you overlooked some overloading?
This
thread is in the certification subforum; is this a certification question? If so, please show the source.