ArthurDn

Untitled

Oct 11th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. import java.lang.reflect.Field;
  2. import java.lang.reflect.Method;
  3.  
  4. class TestClass {
  5.     private int value;
  6.     public String sa;
  7.     int i=(int)Math.random();
  8.     public int getValue() { return value; }
  9.     public void setValue(int valueIn) { this.value = valueIn; }
  10. }
  11.  
  12. public class SimpleComponent {
  13.  
  14.     public static void main(String[] args) {
  15.         int i=(int)Math.random()*2000;
  16.         TestClass testClass = new TestClass();
  17.         Object o=new Object();
  18.         char c[]=new char[6];
  19.         for (Field field: testClass.getClass().getDeclaredFields()) {
  20.             System.out.printf("name: %s, type: %s \n", field.getName(),"2");
  21.            
  22.         }
  23.         System.out.println(i);
  24.         System.out.println(c);
  25.         for (Method method : testClass.getClass().getDeclaredMethods()) {
  26.             System.out.printf("name: %s, return type: %s  \n", method.getName(), method.getReturnType().getCanonicalName());
  27.         }
  28. System.out.println();
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment