Write a Java-program to using static block

Write a Java-program to using static block

Program
public class Main
{
    static
    {
        System.out.println("Welcome");
        System.exit(0);
    }
}

Output:

Welcome
Note: It is not available in latest versions(It works only java 6 before versions).





More Questions


110 . Write a Java-program to print static variable
111 . Write a Java-program to using static block
112 . Write a Java-program to print addition ,substraction ,multiplication,division using oops (using single class)
113 . Write a Java-program to print addition ,substraction ,multiplication,division using oops (using multiple classes)
114 . Write a Java-program to print Max Number program using no parametarized constructor with no return type with no parametarized method
115 . Write a Java-program to print Max Number program using no parametarized constructor with no return type with parametarized method
116 . Write a Java-program to print Max Number program using no parametarized constructor with return type with no parametarized method
117 . Write a Java-program to print Max Number program using no parametarized constructor with return type with parametarized method
118 . Write a Java-program to print Max Number program using no parametarized constructor with no return type with no parametarized method
119 . Write a Java-program to print Max Number program using parametarized constructor with no return type with parametarized method
120 . Write a Java-program to print Max Number program using parametarized constructor with return type with no parametarized method