Java Tutorial

 
 
 
 
import java.io.*;


import java.util.*;
/**
 *
 * @author Hira
 */
public class Filespaths {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
        Path p=Paths.get(\"C:\\\\outfile\\\\outfile.txt\");
        System.out.println(p);
        System.out.println(p.toAbsolutePath().toString());
        System.out.println(p.getParent());
        System.out.println(p.getRoot());
        System.out.println(Files.exists(p));
         System.out.println(p.getFileName());
         Files.deleteIfExists(p);


        } catch (IOException ex) {
            System.err.println(ex.getMessage());
        }

    List<Integer> e=Arrays.asList(2,3,5,6,7,8,0);
    List<Integer> f=Arrays.asList(12,13,14,15,16,12,18);
    System.out.println(e);
    System.out.println(f);
    try{
    for(int i=0;i<e.size();i++){
        int o=f.get(i)%e.get(i);
        System.out.println(o);   
    }
    }catch(ArithmeticException g){
        System.err.println(\"Exception caught :\"+g.getMessage());
    }
    }
}

 
 
Didn't find what you were looking for? Find more on File Handling- JAVA