Create Inner class as a static

Hi friends , in java there is no way to create a class static the only way to create this is by creating an inner class.


class OuterClass
{
        static
        {
            InnerClass.main(null);
            System.gc();
            System.exit(0);
        }
        static class InnerClass
        {
        public static void main(String[] args)
        {
            System.out.println("This is inner class");
        }
    }
}

Comments

Popular posts from this blog

How to set background color of navigation bar in iPhone

Checking Device Info in ios

Some Interactive tips to take input form GUI Dialogs