So i am working on a java project for my first semester programming class and I have code here with an error I am stumped on.
The user will input the file name containing equipment information from the terminal. The program will read from the file and put the lines into a tokenizer which will separate the tokens in accordance to commas.
My current code:
public class Project4
public static void main(String args) throws FileNotFoundException
Scanner in = new Scanner(System.in);
System.out.println("Welcome to Transport Canada");
System.out.print("Please enter text file: ");
String filename = in.nextLine();
File file = new File(filename);
Scanner inp = new Scanner(file);
fix = MTBF(inp);
public static String MTBF(String fixing)
StringTokenizer strTokenizer = new StringTokenizer(fixing, ",");
fixing = strTokenizer.nextToken();
The input file looks like this:
So where are my errors, what am I doing wrong and most importantly...HOW FIX!?
Thank you for your time
Re: Beginner Project
Can you show what the problem is? Print out what you read and all of what you process that shows your problem.
what am I doing wrong a