intro/ReadAndPrint

From ggc

Jump to: navigation, search

01 package intro;
02 //start auto-imports
03 import java.io.*;
04 import java.util.*;
05 import wiki.*;
06 //end auto-imports
07 
08 
09 /**
10  * All about my application.
11  @author My Name Here
12  */
13 public class ReadAndPrint
14 {
15   public static void main(String[] args)
16   {
17     System.out.println("Maze:");
18     Scanner scanner=null;
19     try
20     {
21       scanner=new Scanner(Wiki.getInputStream("Maze2.txt"));
22     }
23     catch(IOException e)
24     {
25       System.out.println("Had problems making scanner: "+e);
26     }
27     String total="";
28     System.out.println("Reading...");
29     while(scanner.hasNext())
30     {
31       total+=scanner.nextLine()+"\n";
32     }
33     System.out.println(total);
34   }
35 }


Download/View intro/ReadAndPrint.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter