|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Apr 2008
Messaggi: 35
|
[C#] Reflection
In C# è possibile, e come, passare una 'classe' come parametro?
Cioè quello che in java sarebbe così: Codice:
public class Prova { public Prova(){} public String a(Class<?> d) { return d.getName(); } } public class BasicM { public static void main(String[] args) throws Exception { Prova p=new Prova(); System.out.println(p.a(long.class)); } } Output = long
__________________
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
|
Prova a consultare questo link
__________________
As long as you are basically literate in programming, you should be able to express any logical relationship you understand. If you don’t understand a logical relationship, you can use the attempt to program it as a means to learn about it. (Chris Crawford) |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 21:01.