I am new to programming, and am currently in product management. So I am learning the ropes. I tried this statement:
public class Tuna {
Formatter f;
public void createfile(){
try{
f = new Formatter("help.text");
f.format("%s%s", "firstname ","lastname");
}
catch (Exception e){
System.out.println("You got an error ");
}
}
Now the first statement executes and a file is created, but the second statement does not execute by creating an entry into the file.
At the same time when I created a method called createrecord()
and inserted the f.format(..);
statement it worked.
Can anyone tell me how all of this works?
format
return a string rather actually doing something to its environment? – John Dvorak Dec 23 '16 at 16:11