Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Java by ugurarda ( 8 years ago )
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;


public class Deneme {

 /**
  * @param args
  */
 BufferedReader br;
 Scanner sc;
 String[] arr = new String[5];
 String temp ="";
   
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  new Deneme().scan();
  
 }
 public void scan()
 {
  
  int i = 0;
  
  try {
   br = new BufferedReader(new FileReader("maze.txt"));
  } catch (FileNotFoundException e) {
   // TODO Auto-generated catch block
   try {
    
    while((temp = br.readLine()) != null)
    {
     arr[i] = temp;
     i++;
    }
   } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
   }
   e.printStackTrace();
  }
  for(int j = 0;j < 5; j++)
  {
   System.out.println(arr[j]);
  }
 }

}

 

Revise this Paste

Your Name: Code Language: