Writing Data to a file using and on console using PrintWriter

 

// Java PrintWriter class is the implementation of Writer class.
// It is used to print the formatted representation of objects
// to the text-output stream.

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;

class PrintWriterDemo {

public static void main(String[] args)
throws FileNotFoundException, IOException {
PrintWriter writer = new PrintWriter(System.out);
//Writing on console
writer.write("Java Invent");
writer.flush();
writer.close();

//writing in a file using printStream
PrintWriter writer1 = new PrintWriter("printwriter.txt");
writer1.write("welcome to Java Invent");
System.out.println("Success....");
writer1.flush();
writer1.close();
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...