Passing Class Reference to method

N

nick

Hello People

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

Here is the sample code from class A
Code:
public Integer[] getReport(Class classname, String sql) {

And, then when it is called inside class C, it is referred to as ,
Code:
new A().getReport(B.class, "select * from Table A")

where B is another class

Please give your suggestions on this

Thanks

Nek
 
L

Lew

Mark said:
nick said:
Hello People

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

Here is the sample code from class A
Code:
public Integer[] getReport(Class classname, String sql) {

And, then when it is called inside class C, it is referred to as ,
Code:
new A().getReport(B.class, "select * from Table A")

where B is another class

<http://java.sun.com/docs/books/tutorial/extra/generics/literals.html>

Also, the cited signature for 'getReport()' omits the generics type parameter
for 'Class'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top