We can create the object of a class from any where either in the same class or from the other class.When created with in a class we created under main method.As it was the entry point
Syntax to create an object
program p=new program() is for allocate memory
Syntax to create an object
<class> <obj>=new <class>([<arglist>]) program p=new program() p.method1(); p.method2(); p.method3();Here program p is object ,
program p=new program() is for allocate memory
No comments:
Post a Comment