fursty

OOP Upr 7 File WiP Scanner

Mar 12th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. package Reader;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class ScannerReader {
  6. public Object readFile(String fileName) {
  7. try {
  8. Scanner file = new Scanner( new File(fileName));
  9. int i=0;
  10. while(file.hasNextLine()) {
  11. rectangles[i++] = new ColorRectangle()
  12.  
  13. file.nextInt();
  14. file.nextInt();
  15. file.nextInt();
  16. file.nextInt();
  17. file.nextInt();
  18.  
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment