Saturday, January 21, 2006

Top-Techies(C# Interview Questions)

  1. What’s the implicit name of the parameter that gets passed into the class’ set method? Value, and its datatype depends on whatever variable we’re changing.
  2. How do you inherit from a class in C#? Place a colon and then the name of the base class. Notice that it’s double colon in C++.
  3. Does C# support multiple inheritance? No, use interfaces instead.
  4. When you inherit a protected class-level variable, who is it available to? Classes in the same namespace.
  5. Are private class-level variables inherited? Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.
  6. Describe the accessibility modifier protected internal. It’s available to derived classes and classes within the same Assembly (and naturally from the base class it’s declared in).
  7. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there’s no implementation in it.
  8. What’s the top .NET class that everything is derived from? System.Object.
  9. How’s method overriding different from overloading? When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.
  10. What does the keyword virtual mean in the method definition? The method can be over-ridden.
  11. Can you declare the override method static while the original method is non-static? No, you can’t, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override.
  12. Can you override private virtual methods? No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.
  13. Can you prevent your class from being inherited and becoming a base class for some other classes? Yes, that’s what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class WhateverBaseClassName. It’s the same concept as final class in Java.
  14. Can you allow class to be inherited, but prevent the method from being over-ridden? Yes, just leave the class public and make the method sealed.
  15. What’s an abstract class? A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, it’s a blueprint for a class without any implementation.
  16. When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)? When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden.
  17. What’s an interface class? It’s an abstract class with public abstract methods all of which must be implemented in the inherited classes.
  18. Why can’t you specify the accessibility modifier for methods inside the interface? They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, it’s public by default.

19 Comments:

Anonymous Anonymous said...

Nice site!
[url=http://udywxqkt.com/grmk/fyks.html]My homepage[/url] | [url=http://owqvtdhp.com/oabv/xxbs.html]Cool site[/url]

10:25 PM

 
Anonymous Anonymous said...

Nice site!
My homepage | Please visit

10:26 PM

 
Anonymous Anonymous said...

Great work!
http://udywxqkt.com/grmk/fyks.html | http://fzrzdcnh.com/evwk/tzxw.html

10:26 PM

 
Anonymous Anonymous said...

Wow, man! Cool site!


replica louis vuitton handbag

how to get cash advance from your paycheck

quick payday cash

loan personal quick small

no fax payday advance loan
payday paycheck loan

advance cash loan loan online payday payday

advance lender loan payday

emergency fax loan no payday

home loan calculation

credit fico free report score

Good Luck!

1:10 AM

 
Anonymous Anonymous said...

Hello, very nice site! Please also visit my homepages:


buy phentermine yellow

buy cod online pay tramadol

buy carisoprodol diazepam online soma

tadalafil soft tab

buy tadalafil

atarax effects medication side

buy cheap phentermine cod

With best regards...

8:05 PM

 
Anonymous Anonymous said...

Finally the real thing - no more ripoffs! Enhancement Patches are hot right now, VERY hot! Unfortunately, most are cheap imitiations and do very little to increase your size and stamina.
Well this is the real thing, not an imitation! One of the very originals, the absolutely strongest Patch available, anywhere!

Check out the site http://www.seemoco.info for more info TODAY, you'll be glad you did ;)

Penis Growth Patch

______________________________________________
Our others products:
Ultra Allure Pheromones
Anatrim
Advanced Gain Pro Pills
Regenisis HGH

10:15 PM

 
Anonymous Anonymous said...

"I have been using Advanced Gain Pro for 3 months now and I must say I'm simply amazed. I really didn't think the product would have this many benefits. I really only purchased the pills to help the reliability of my erections. But to my surprise every aspect of my penis and sex life has improved. I have larger, harder erections easily, and I can really satisfy my girlfriend fully now."
Dexter, Chicago

Finally! A new pill that really works!

________________________________
Our others products, more info here:
Ultra Allure Pheromones
Anatrim

10:57 PM

 
Anonymous Anonymous said...

I will recommend you to all my friends!

buy hoodia diet pills


weight loss patches


Good Luck!

9:22 PM

 
Anonymous Anonymous said...

Very useful site, nice :)
online drug store
drug store pharmacy online
discount drug store online
canadian online drug store
cheap online drug store
prescription drug store online
canada online drug store
drug foreign online store
online drug store ultram
drug medication online prescription store
drugstore online
online drugstore
online drugstores
mexico online drugstores
1 drugstore online
canadian online drugstores
online drugstores spain
foreign drugstores online
Bye!
herbal viagra

8:20 AM

 
Blogger Sat said...

Yuo did a great work.
Keep it up buddy.
Thanks
Alex @ css design flash web

12:56 PM

 
Blogger micky said...

It's really a cool site. Man you really did a great job. See I too have unsuccessfully try to attempt to recreate the similar model when I was in web site design company . Kudoos for your performance....

2:15 PM

 
Anonymous Web Design Company said...

Web Design Company | Web Design India | TheWebMento is a leading Web Site Design Company from India providing Website Design | Web Development Services, E-commerce - provider , Multimedia Presentations, SEO, Web Page Design, Software Development, Flash/3D Animations, Search Engine Optimization ,Web Promotion and Logo Designing. TheWebMento is based at Lucknow, India

2:28 PM

 
Anonymous viagra said...

The anti-impotency treatment you are going to adopt just after being identified with erectile dysfunction is not likely to yield any fruitful result if you do not abide by the precautionary instructions recommended by the physician. For instance, after procuring viagra online if you administer cheap viagra without providing the necessary details to the doctor with regard to your medical history then there are chances that viagra intake might prove disastrous to you. Most particularly, if you are taking nitrate based medicine such as nitroglycerin patches to treat a specific medical condition you should inform the doctor immediately so that he doesn’t suggest you to buy viagra. The usage of Viagra by any person using nitrate-based medicines can trigger off health disaster and as such you can definitely avoid the imminent harm by explaining your medical history to the doctor and avoiding to buy viagra online if the drug is not meant for you.

1:55 PM

 
Anonymous web design company in uk said...

Planet E-Com Solutions (PECS) is a leading web design company in UK offering web design, web development, software development , seo services web design company is based at delhi, Mumbai India , London UK .

12:40 PM

 
Anonymous Floor Entrance Mats said...

Tacky Mats - Floor Entrance Mats tackymats.co.uk are the UK leading online provider of sticky floor entrance mats, Supply Sticky Mats, tack rags and wipes and sticky rollers.tacky mats,tackymats,tacky,mats,wipes,rags,sticky rollers,rollers,entrance mats,floor mats,easy peel,clean rooms,cleanrooms,health care,cleanliness,dirt,cumbria,uk

3:19 PM

 
Blogger barb michelen said...

Hello I just entered before I have to leave to the airport, it's been very nice to meet you, if you want here is the site I told you about where I type some stuff and make good money (I work from home): here it is

3:07 PM

 
Anonymous Herbal products said...

We distribute 100% natural and pure herbal products with no added chemicals, colours and additives. Our products include Skin & Beauty products, Massage oils, Herbal Soaps, Herbs, Herbal Teas, Herbal Remedies and health products. Our products are manufactured in ISO 9001:2000 certified GMP plant and are made as per quality standards approved by the Government of India and are acceptable in different countries. We can provide our services for 'Contract manufacturing' of different herbal products under your Brand, label design, as per your specifications. Currently we are exporting our products to UK, France, Canada, Germany, Austria, UAE, USA, Netherlands etc.

3:10 PM

 
Anonymous Anonymous said...

Generic Cialis is the buzzword prescribed for all patients suffering from impotence. Generic Levitra is an FDA-approved oral medication to treat erectile dysfunction (ED) in men. Generic Viagra is used in the treatment of Erectile Dysfunction (impotence), but it is not a cure. Impotence can be caused by a number of factors, either physical or psychological. Viagra can help maintain an erection but it will not stimulate arousal.

12:23 PM

 
Anonymous Anonymous said...

Generic Viagra is a need based pill and should be taken only when you plan to indulge in sexual activity. Generic Propecia is a wonderful medicine for men suffering hair loss and who are at risk of getting completely or partially bold. Propecia can also help you at the beginning stages of some prostatic problems. Viagra improves erections for most men no matter how long they have had erectile dysfunction, taken approximately 30 minutes before your plan of sexual activity and works on stimulation for around 4 hours.

2:29 PM

 

Post a Comment

<< Home