hi , Good Morning friends.
In C#.Net for which classes we create object(i.e instance) to call methods and properties?
For which classes we don't create object.In this situation how we access the methods and properties?
I am always confused in the interview.
please give detail description about classes and their uses.
Thanks in advance.
Loading
prasanna pPosted May 3, 2015, 6:24 AM
hi Riddhi valecha,
I am not asking about class Library.we have different classes like abstract,Interface,sealed and static classes ...etc.
In these classes for which we create object to the class and for which do not create object.?
Thank you
Riddhi ValechaPosted May 3, 2015, 5:48 AM
For classes and methods, I will suggest you to use a Class Library...
Reasons -
Using App_Code is not advisable as -
1. It will increase the number of files in the server (once you publish the website and put it in server).
2. It gets compiled automatically, and do not have Strong Assembly Names.
3. They will be re-compiled when a change occurs in the code.
ClassLibrarySolution -
We just build it, and use its dll file in the solution.
Dipankar BiswasPosted May 3, 2015, 1:38 AM
check this links..
http://stackoverflow.com/questions/16832280/why-we-do-create-object-instance-from-interface-instead-of-class
http://stackoverflow.com/questions/2700256/why-cant-create-object-of-an-abstract-class