package Test.return;
public class returnDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
returnDemo rd=new returnDemo();
//rd.print();
System.out.println(rd.print());
}
String print(){
System.out.println("fads");
return "nihaho";
}
}
result:
fads
nihaho
问:return String 还执行里面的System.out.println("fads") ?
|
|