Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Java program main function with object

/**
             * @Prof. Jayesh
             * Here two classes are created each having main function
             * A class calls the main() of another class
             */

class FunctionOne{

            void show()
            {
                        System.out.println(“I am in FunctionsOne”);                         
            }
           
            public static void main(String args[])
            {
            FunctionsInJava fij = new FunctionsInJava();
            fij.FunctionsInJava();
           
            FunctionOne fo = new FunctionOne();
            fo.show();
            }
}


public class FunctionsInJava {
           
            void FunctionsInJava()
            {
                        System.out.println(“I am in FunctionsInJava”);
                       
            }
           
            public static void main(String[] args) {
                        // Primary main()
                        FunctionOne fo = new FunctionOne();
                        fo.main(args); // another class main() call here
                       
            }

}