透传

  1. 透传
  Student magotan = new Student(1, "NEW MAGOTAN");
  Student passat = new Student();
  // 将迈腾的组件复制到帕萨特中
  BeanUtils.copyProperties(magotan, passat);
  System.out.println(JSON.toJSON(passat));
  // TODO: {"name":"NEW MAGOTAN","id":1}
原文地址:https://www.cnblogs.com/Twittery/p/14911854.html