Tuesday, 25 April 2017

How to Create Whole Path Automatically and write into File In Java

        File file = new File("/home/anand/Desktop/filename.html");
        file.getParentFile().mkdirs();
        FileWriter writer = new FileWriter(file);
       
        bw = new BufferedWriter(writer);
        PrintWriter  out = new PrintWriter(bw);
        out.println("<h4>Welcome in Bangalore</h4>");
        out.close();

Java Interview question and answer

  Java Backend Interview Prep — Q&A Guide Java Backend Interview Prep 24 topics · 287 questions Expand all Collap...