Thread: Reading problem
View Single Post
Newbie Member
21Apr2011,16:25  
And Rew _ 2's Avatar
Code:
    public static void main(String[] args) {

        try
        {
        Scanner read   =  new Scanner(new File("file.in"));
        while(read.hasNext())
            {
           ??????????????
            }
        myLinkedList LL = new myLinkedList ();
                
                    for(int i=1;i<=t;i++)
                        {
                                LL.addLast(i);
                        }
                        LL.remove(s);

                 

        }
       
        // catch
                catch(Exception e)
        {
            System.out.println(e);
        }

    }
This the code , i could not edit in the first post , this not compile just to explain the idea.



this one is compile and work when i put the value of s and t by myself
Code:
    public static void main(String[] args) {

        try
        {
        Scanner read   =  new Scanner(new File("file.in"));
  
        myLinkedList LL = new myLinkedList ();
                
                    for(int i=1;i<=9;i++)
                        {
                                LL.addLast(i);
                        }
                        LL.remove(4);

                 

        }
       
        // catch
                catch(Exception e)
        {
            System.out.println(e);
        }

    }
It is compile and work !
what i posted just to explain my problem where is it. =)