Without writing main() method, is it possible to print some statements to the console?

Answer:
->Yes we can print by using static block.
->But this rule is applicable unti 1.6 version only.
From 1.7 version onwards main() method is mandatory to print some statements
to the console.

->Whether class contains main() method or not and whether main() method is
declared according to requirement or not, these things will not be checked by
Compiler. At runtime, JVM will be responsible to check these things.

->At runtime if JVM is unable to find required main() method then we will get
runtime exeception saying NoSuchMethodError.

class Test{

}

javac Test.java
java Test
RuntimeException: NoSuchMethodError.main

Case1:
Until 1.6 version if the class doesn't contain main() method then we will get
RuntimeException saying NoSuchMethodError. But from 1.7 version onwards,
Instead of NoSuchMethodError we wil get more meaningful error information.
i.e. Error: Main method not found in class, Please define main method as
public static void main(String[] args)

Case 2:
From 1.7 version onwards to run a java program main method is mandatory. Hence,
even though class contains static blocks they will not be executed, if main
method is not present.
Example:
Class Test{
    Static{
        System.out.println("Static block");
    }
}
Version 1.6 Output: Static block
            RE:NoSuchMethodError:main

Version 1.7 Error: main method not found in class.

Example: If the class contains main() method whether it is 1.6 or 1.7 version,
there is no change in execution sequence.
Class Test{
    static{
        System.out.println("static block");
    }
    public static void main(String[] args) {
        System.out.println("main method");
    }
}
version 1.6 : output: static block
                      main method
version 1.7 : output: static block
                      main method

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...