TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abid Khan
NA
245
25.7k
How to invoke or instantiate obj using private constructor?
Jan 20 2015 6:21 AM
Hello, i would like to know how to instantiate an object using private constructor? and what are the main benefits to use private constructor?
namespace Practice
{
public class Test
{
int a;
public Test()
{
}
private Test(int a)
{
this.a = a;
}
}
public class Test2
{
void method()
{
Test obj1 = new Test();
}
}
}
Reply
Answers (
2
)
viewing sms in system
I want to write a program in C does the following