Buy Questpond's video subscriptions on
huge discount
.
Online: 7841
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
Others
>
Loading ...
Can a class have a private constructor?
Posted by
Im4uonli
under
Others
on 3/16/2009 | Views : 5211 | Status :
[Member]
| Replies : 7
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
Yes, A class can have a private constructor but other classes can not instantiate the class using that constructor.
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Vuyiswamb
on: 3/16/2009
[Member]
[MVP]
[Administrator]
NotApplicable
0
What is the Purpose of what you are doing ?
Thank you for posting at Dotnetfunda
[Administrator]
Im4uonli
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Thulanekhz
on: 3/16/2009
[Member]
Starter
0
Why are you wasting IIS resources, you ask a question then answer yourself. The purpose of this forum is to learn and not play
Im4uonli
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Vuyiswamb
on: 3/16/2009
[Member]
[MVP]
[Administrator]
NotApplicable
0
Easy Thulane don't Fight.
Mybe he made a mistake
Thank you for posting at Dotnetfunda
[Administrator]
Im4uonli
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Poster
on: 3/16/2009
[Member]
Starter
0
Dear im4uonli,
May we suggest to spread your knowledge in the Interview section or Codes section.
I think those sections are made for that purpose and that will help everyone to find them easily.
Im4uonli
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Im4uonli
on: 3/16/2009
[Member]
Starter
0
My dear Thulane and all, Don't get excited, and if you have more knowledge then share it.
I also want to know that, if no other class can create an object using this constructor, then why this feature is provided at all.
I hope U will get the point.
Im4uonli
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Vuyiswamb
on: 3/16/2009
[Member]
[MVP]
[Administrator]
NotApplicable
0
Dear Im4uonli
Thulane and all were harsh to you, We apologise for that. But Please before you post make sure that we will understand what you have posted. Secondly please do not post contents that would have been posted Code in the Forums.
Well you can instantiate the Constructor if its Private.
Thank you for posting at Dotnetfunda
[Administrator]
Im4uonli
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Poster
on: 3/17/2009
[Member]
Starter
0
Dear Im4uonli,
There is use of Private constructor when you are working with design pattern. Like if you want to work on Singleton design pattern you will have to use Private constructor to ensure that only one instance of the object exists.
For more details on this see
http://www.dotnetfunda.com/articles/article69.aspx
On another note, I think the content of your post in starting of this thread confused everyone. That doesn't look like a question, it seems you tried to answer your question thats why everyone got confused.
Thanks
Im4uonli
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...