0

how do i read in files from a ".txt" file into a linked list

heres my code.

import java.io.*;
    public class LinkedList1
   {
   
       class Node
      {
         String element;	// list element
         Node next; 			// successor link
      
          Node(String el, Node n)
         {
            element = el;
            next = n;
         }
      
          Node(String el)
         {
            element = el;
            next = null;
         }
      
      }
   
       public static main (String[] args)
      {
         Node myList = new Node("1");
      // AT THIS PART OF MY CODE I WANT TO READ IN INTEGERS  FROM A ".txt" FILE
      // USING FILE IO HOW DO I DO THAT?
      }
   }
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by BestJewSinceJC
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.