Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package po2.td2;
- import java.io.*;
- import java.util.Scanner;
- /**
- * @author J.-F. Remm
- * @version 1
- */
- public class Lecture {
- private static double getDouble()
- {
- return 0.0;
- }
- public static void main(String[] args) {
- String nom;
- System.out.print("Chemin :");
- Scanner sc = new Scanner(System.in);
- nom = sc.next();
- Scanner scan = null;
- try {
- scan = new Scanner(new File(nom));
- while(scan.hasNext()) {
- System.out.println(scan.next());
- }
- }
- catch(FileNotFoundException e){
- System.out.println(e.getMessage() + " ");
- }
- finally {
- sc.close();
- scan.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement