Possible Duplicate:
Is Java pass by reference?
when I used some java class like (Integer, File, Boolean) if I pass the instance as an argument to a function and try to change its value after I use this value outside function, the value remains unchanged.
例如:
private void run(){
File tmpFile;
setFile(tmpFile);
System.out.println(tmpFile.getAbsolutePath()); //error tmpFile is null
}
private void setFile(File xFile){
xFile = jFileChooser.getSelectedFile(); // this returned object file
}