Monday, 29 June 2015

Executing a class without main in java

You can write a class in java without main() method as here


class DemoFirst{

      static{
      System.out.println("Hello Friends....");
      }
}

and you can execute this class as well , But here is a thing to consider is,  " It is possible with java jdk-1.5 and lower versions ". If you execute this class with jdk-1.6 or higher version you will get an error.
------------------------------------------------------------------------------------------------------------------------
Compilation and Execution :

D:\Training Data>javac DemoFirst.java

D:\Training Data>java DemoFirst
Error: Main method not found in class DemoFirst, please define the main method as:
   public static void main(String[] args)





Sending file as multi-part MIME over http in ACE - esql

  How to send a file over http as a multipart mime? Below are the steps to do that - 1. Make sure you have the data encryption in place for ...