Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. package annotationeventtest;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.FileReader;
  5. import java.io.IOException;
  6.  
  7. public class HelloWorld {
  8.  
  9.     public HelloWorld() {
  10.  
  11.         try {
  12.             BufferedReader reader = new BufferedReader(new FileReader("hello.txt"));
  13.  
  14.             int count = new Integer(reader.readLine());
  15.  
  16.             for (int i = 0; i < count; i++) {
  17.  
  18.                 System.out.println("Hello " + reader.readLine() + "!");
  19.  
  20.             }
  21.         } catch (IOException ignored) {}
  22.  
  23.     }
  24.  
  25.     public static void main(String[] args) {
  26.         new HelloWorld();
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement