Sandeep Kumar
How to create object of Class ?
By Sandeep Kumar in .NET on Dec 19 2015
  • Paul
    Oct, 2016 25

    Syntax:- class_name variable_name(or)ObjectName = new class_name( ); Example:- Birthday ObjMessage = new Birthday( );Birthday ->Class Name.ObjMessage ->ObjectName. by using this objectname we can access all methods available in that class.If method is public means we can access it throughout the application.if method is private means we can access it within the class file.if method is public means we can access it within the class as well as derived class.

    • 1
  • Munesh Sharma
    May, 2016 31

    YourClassName object=new YourClass Name();

    • 0
  • Dharmendra Rai
    Jan, 2016 6

    For this you have to know, what is Object actually... An Object within Object Oriented Programming is an instance of a Class. Objects (instances) are created from the Class using the keyword "new". You can create as many instances of a class as you would like. When a new Object is created, then memory will be allocated for the class in heap memory area, which is called as an instance and its starting address will be stored in the object in stack memory area.Now you can create a object of class like this.....ClassName clsname= new ClassName();

    • 0
  • Sandeep Kumar
    Dec, 2015 19

    Syntax for creating object of class is : Class Name object=new Class Name();

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS