Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3. public class Practice12 {
  4.     public static void main(String[] args) {
  5.        
  6.         String src=null, dst=null;
  7.         Vector<String> v=new Vector<String>();
  8.        
  9.         System.out.println("전체 경로명이 아닌 파일 이름만 입력하는 경우, 파일은 프로젝트 폴더에 있어야 합니다.");
  10.        
  11.         System.out.print("첫번째 파일 이름을 입력하세요>>");
  12.         Scanner scanner1= new Scanner(System.in); src=scanner1.nextLine();
  13.         v.add(src);
  14.         System.out.print("두번째 파일 이름을 입력하세요>>");
  15.         Scanner scanner2=new Scanner(System.in); dst=scanner2.nextLine();
  16.         v.add(dst);
  17.         System.out.println(src+"와 "+dst+"를 비교합니다.");
  18.        
  19.        
  20.        
  21.        
  22.         System.out.println("파일이 같습니다.");
  23.        
  24.         System.out.println("파일이 다릅니다.");
  25.         try{
  26.             FileInputStream file1=new FileInputStream("v.get(src)");
  27.             FileInputStream file2=new FileInputStream("v.get(dst)");
  28.         }catch(IOException e) {
  29.             System.out.println(e);
  30.             }finally {
  31.             /*  try{
  32.                    
  33.                     }catch (IOException io) {}*/
  34.         System.out.println("입출력 오류가 발생했습니다.");
  35.        
  36.        
  37.        
  38.        
  39.         int srcCount=0, destCount;
  40.        
  41.        
  42.        
  43.        
  44.        
  45.        
  46.        
  47.        
  48.        
  49.         for(int i=0;i<srcCount;i++) {
  50.            
  51.                 }
  52.             }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement