Here is the error message I am getting:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind
ex out of range: -1
at...
Type: Posts; User: taze
Here is the error message I am getting:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind
ex out of range: -1
at...
So I have this:
import java.util.*;
import java.io.*;
public class StoryGenB {
public static void main(String[] args) {
file();
}
So I fixed that so the current code is this:
import java.util.*;
import java.io.*;
public class StoryGenB {
public static void main(String[] args) {
file();
}
So I did realize that I wasn't printing anything out to the filewriter, and I renamed it like above so that my code is now this:
import java.util.*;
import java.io.*;
public class StoryGenB {...
Doesn't f.close() near the end of the code do the flush/closing of the FileWriter? It still only creates a blank document instead of writing the text.
Unfortunately, FileWriter is not something I've learned and I have any idea how to implement to the above code, likewise the file we have to use to bring the story has to be declared early on (when...
I've gotten sort of stuck on my assignment for my Java class and I was wondering if anyone could point me in the right direction.
The general idea of what is intended is that the computer will...