Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enter code here{
- import java.util.Scanner;
- import java.io.*;
- public class test {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner sc = new Scanner (System.in);
- BagBase bb = new BagBase();
- //System.out.println("Please enter items into the bag: ");
- try {
- start();
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- enter code here
- /** This method need to read list from text file and put bag[]
- public static void start() throws FileNotFoundException {
- BagBase bb = new BagBase();//
- Scanner sc = new Scanner (System.in);
- String wow;
- File f = new
- File("C:/Users/sruja/workspace/Prjocet1/src/ListForBag.txt");// I this where the location of the file was
- Scanner aa = new Scanner (f);
- wow=aa.nextLine();// read in
- bb.inserItem(wow);// this add into the bag array
- System.out.println("your list is done");
- bb.prints();// prints the enter array
- }
- }
- java.io.FileNotFoundException: C:UserssrujaworkspacePrjocet1srcListForBag.txt (The system cannot find the file specified)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement