how to read nextline of textfile in java :        import java.io.*;
       import java.util.*;
       public class stringstore
     {
	   public static void main(String[] args)
	{
		File file = new File("C:\\a.txt");
     try
    {
	String strIP="";
    Scanner sc = new Scanner(file);
    while(sc.hasNext())
    {
        String line = sc.nextLine();
        String str[] = line.split(", ");
    	strIP = str[0];
    }
    System.out.println(strIP);
    }
    catch(IOException e)
    {
      // work with the errors here
    }
	  }
    }
How do i read a nextline from a textfile and display it.Please help. Its urgent and i want to know this as early as possible. Thanking You'll in advance.