黑马程序员技术交流社区
标题:
DOS命令与Myeclipse的输出有什么不同
[打印本页]
作者:
杨曾荣
时间:
2012-2-28 16:15
标题:
DOS命令与Myeclipse的输出有什么不同
写了个相同的代码,在两个运行环境下输出不同的结果
class FieldTest
{
public static void main(String[] args) throws Exception
{
Person person=new Person();
Object value="杨曾荣,努力点";
String propertyName="name";
setProperty(person,propertyName,value);
System.out.println(person);
}
public static void setProperty(Object obj,String propertyName,Object value)
throws Exception
{
Class clazz=obj.getClass();
Field field=clazz.getDeclaredField(propertyName);
field.setAccessible(true);
field.set(obj,value);
}
}
在Myeclipse运行的时候能够把“杨曾荣,努力点";全都打印出来,而在DOS命令下只输出了“杨曾荣”。
两者的输出方式有何区别?
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2