I'm not really an expert at this, but I can tell you a bit about the io exception in general. io is a class you need to import into your code at the top ie/
import java.util.Scanner;
import java.io.*;
public class stocks {
public stocks(){
}
public static void main(String[] args) throws IOException {
I have also imported the Scanner object here.
This: public static void main(String[] args) throws IOException means the Scanner will throw IOException if something unexpected happens. If that happens, the main method will not continue and will display an error. It looks like your program stopped because something unexpected happened with an object in the main method. I would check my import of Scanner or whatever other object you were throwing the exception for. Sometimes I have the correct line written for my imports, but my gui wants it written differently. If that's happening, you should write one word at a time and select the next words from the drop down menu.
For my code, I will also need to write IOEXception into the header of any method that uses scanner. If the main method doesn't use scanner but calls a method that does, I need to put "throws IOEXception" in both methods' headers. If you have more than one method, try that and see if you still getting an error.
I hope this helps. Please let us all know if this was the question you were asking, and post your code and ask again if it isn't.
BUGS THE CRAP OUT OF ME, please help!
Link Removed
import java.util.Scanner;
import java.io.*;
public class stocks {
public stocks(){
}
public static void main(String[] args) throws IOException {
I have also imported the Scanner object here.
This: public static void main(String[] args) throws IOException means the Scanner will throw IOException if something unexpected happens. If that happens, the main method will not continue and will display an error. It looks like your program stopped because something unexpected happened with an object in the main method. I would check my import of Scanner or whatever other object you were throwing the exception for. Sometimes I have the correct line written for my imports, but my gui wants it written differently. If that's happening, you should write one word at a time and select the next words from the drop down menu.
For my code, I will also need to write IOEXception into the header of any method that uses scanner. If the main method doesn't use scanner but calls a method that does, I need to put "throws IOEXception" in both methods' headers. If you have more than one method, try that and see if you still getting an error.
I hope this helps. Please let us all know if this was the question you were asking, and post your code and ask again if it isn't.