1. public static void main(String[] args) throws SecurityException, ClassNotFoundException, IllegalArgumentException, IllegalAccessException   
  2.  {   
  3.   TestEntity obj = new TestEntity();   
  4.   obj.setName("name value");   
  5.   obj.setCode("code value");   
  6.   Field[] fds = Class.forName   
  7.   ("com.test.impl.TestEntity").getDeclaredFields();   
  8.      
  9.   System.out.println(fds.length);   
  10.   for(int i=0;i<fds.length;i++)   
  11.   {   
  12.    System.out.println(fds[i].get(obj));   
  13.       
  14.   }   
  15.  }  

相关文章:

  • 2021-12-18
  • 2022-01-03
  • 2022-01-17
  • 2022-12-23
  • 2021-11-03
  • 2021-10-02
猜你喜欢
  • 2022-02-27
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
相关资源
相似解决方案