Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. import java.io.File;
  2. import java.io.FileNotFoundException;
  3. import java.util.Scanner;
  4.  
  5. public class Marta {
  6.     public static void main (String [] args) {
  7.             File file = new File("ala.txt");
  8.             System.out.println(file.exists());
  9.             Scanner in = null;
  10.             try {
  11.                 in = new Scanner(file);
  12.             } catch (FileNotFoundException e) {
  13.                 e.printStackTrace();
  14.             }
  15.             String zdanie = in.nextLine();
  16.             System.out.println(zdanie);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement