C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
4
Reply
How to create object of Class ?
Sandeep Kumar
9y
582
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
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.
Paul
9y
1
YourClassName object=new YourClass Name();
Munesh Sharma
9y
0
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();
Dharmendra Rai
9y
0
Syntax for creating object of class is : Class Name object=new Class Name();
Sandeep Kumar
9y
0
What is polymorphism and what is type of polymorphism?
How many method is there to remove unreachable object from memory?
Message