Results 1 to 3 of 3
  1. #1
    deepode is offline Member
    Join Date
    Apr 2012
    Location
    Gujarat , India
    Posts
    5
    Rep Power
    0

    Unhappy Very noob : Pls describe this code :P

    Java Code:
    import java.io.*;
    import java.util.Scanner;
    
    public class ScanXan {
        public static void main(String[] args) throws IOException {
    
            Scanner s = null;
    
            try {
                s = new Scanner(new BufferedReader(new FileReader("xanadu.txt")));
    
                while (s.hasNext()) {
                    System.out.println(s.next());
                }
            } finally {
                if (s != null) {
                    s.close();
                }
            }
        }
    }
    I didn't understand what is hasNext() and what is next()

    may be look too noob but hope i will get help.

    :(sweat)::(-::=-::=(::s::(doh):

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: Very noob : Pls describe this code :P

    Have you read the API documentation for the Scanner class? Noone can do without the API documentation. Here it is: link.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: Very noob : Pls describe this code :P

    Please go through the Forum Rules -- particularly the third paragraph.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. I am a super noob with a super noob question.
    By LittleZoppo in forum Java Applets
    Replies: 3
    Last Post: 04-27-2012, 03:50 AM
  2. help in describe code
    By m1ke4fun in forum New To Java
    Replies: 5
    Last Post: 10-21-2011, 06:05 PM
  3. Replies: 2
    Last Post: 04-01-2010, 12:55 PM
  4. [SOLVED] Please describe this code
    By ezee in forum New To Java
    Replies: 12
    Last Post: 03-18-2009, 05:33 PM
  5. Help im a noob.. a super noob on java..
    By critdevil in forum New To Java
    Replies: 12
    Last Post: 03-07-2009, 03:17 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •