tachia

Untitled

Sep 3rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4.  
  5. public class console{
  6.     Rectangle rect;
  7.     private Scanner scanner;
  8.     public void openFile(){
  9.         try{
  10.             scanner=new Scanner(new File("data.txt"));
  11.         }catch(Exception e){
  12.             System.out.println("cant find file");
  13.            
  14.         }  
  15.     }
  16.     public void readFile(){
  17.         while(scanner.hasNext()){
  18.             int first=Integer.parseInt(scanner.next());
  19.             int second=Integer.parseInt(scanner.next());
  20.             int third=Integer.parseInt(scanner.next());
  21.             int fourth=Integer.parseInt(scanner.next());
  22.             rect.makeRect(first,second,third,fourth);
  23.         }
  24.        
  25.        
  26.     }
  27.    
  28.    
  29. }
Advertisement
Add Comment
Please, Sign In to add comment