code needs a quick look =C)
Does anyone know why i would be an error would be generated
from this code. I keep getting:
static public String createFile(){
^
missing return statement.
I dont understand, im returning a String? I should be able to invoke a method from within a constructor call right???
import java.io.*;
class fileTest{
public static void main(String[] args){
try{
FileOutputStream fout = new FileOutputStream(createFile());
}catch(IOException e){System.err.println(e);}
} // end main
static public String createFile(){
File f = new File("C:\tempfile.txt");
try{
f.createNewFile();
String filename = f.getName();
return filename;
}catch(IOException e){System.err.println(e);}
}
} // end class