Hello People

Please suggest me the use of passing class reference in a method

Here is the sample code from class A

public Integer[] getReport(Class classname, String sql) {

And, then when it is called inside class C, it is referred to as ,

new A().getReport(B.class, "select * from Table A")

where B is another class

Please give your suggestions on this

Thanks

Nek

Recommended Answers

All 2 Replies

Well, apparently whoever wrote those methods are using that class as a key or with reflection.
I don't see how you expect anyone to know the "why" details of someone else's code based upon a method signature.

Thanks for your suggestions

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.