<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Solomon &#187; C# OOPS &#8211; Interview Questions</title>
	<atom:link href="http://www.ms.oyangudi.com/blog/tag/c-oops-interview-questions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ms.oyangudi.com/blog</link>
	<description>from Oyangudi...</description>
	<lastBuildDate>Tue, 18 Oct 2011 02:38:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>C# OOPS Interview Questions</title>
		<link>http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/</link>
		<comments>http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 03:44:52 +0000</pubDate>
		<dc:creator>Solomon</dc:creator>
				<category><![CDATA[Interview Questions - C# - OOPS]]></category>
		<category><![CDATA[C# OOPS - Interview Questions]]></category>

		<guid isPermaLink="false">http://www.ms.oyangudi.com/blog/?p=13</guid>
		<description><![CDATA[Collected from the Internet: Class Questions 1.What is the syntax to inherit from a class in C#? Ans.Place a colon and then the name of the base class. Example: class MyNewClass : MyBaseClass 2. Can you prevent your class from being inherited by another class? Ans.Yes.&#160; The keyword &#34;sealed&#34; will prevent the class from being [...]]]></description>
			<content:encoded><![CDATA[<div class="simplesocialbuttons">
<div class="simplesocialbutton ssb-button-googleplus"><!-- Google Plus One--><g:plusone size="medium" count="true" href="http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/"></g:plusone></div>
<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><fb:like href="http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/" send="false" layout="button_count" width="100" show_faces="false" action="like" font=""></fb:like></div>
<div class="simplesocialbutton ssb-buttom-twitter"><!-- Twitter--><a name="twitter_share" data-count="horizontal" href="http://twitter.com/share" data-text="C# OOPS Interview Questions" data-url="http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/" class="twitter-share-button" rel="nofollow"></a></div>
</div>
<p><b>Collected from the Internet:</b>     <br /><b></b></p>
<p><b>Class Questions</b>     <br /><b>1.</b>What is the syntax to inherit from a class in C#?     <br /><b>Ans.</b>Place a colon and then the name of the base class.     <br />Example: class MyNewClass : MyBaseClass     <br /><b>2.</b> Can you prevent your class from being inherited by another class?     <br /><b>Ans.</b>Yes.&#160; The keyword &quot;sealed&quot; will prevent the class from being inherited.     <br /><b>3.</b>Can you allow a class to be inherited, but prevent the method from being over-ridden?     <br /><b>Ans.</b>Yes.&#160; Just leave the class public and make the method sealed.     <br /><b>4.</b>What&#8217;s an abstract class?     <br /><b>Ans.</b>A class that cannot be instantiated.&#160; An abstract class is a class that must be inherited and have the methods overridden.&#160; An abstract class is essentially a blueprint for a class without any implementation.     <br /><b>5.</b>When do you absolutely have to declare a class as abstract?     <br /><b>Ans.      <br /></b>1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.     <br />2.&#160; When at least one of the methods in the class is abstract.     <br /><b>6.</b>What is an interface class?     <br /><b>Ans.</b>Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.     <br /><b>7.</b>Why can&#8217;t you specify the accessibility modifier for methods inside the interface?     <br /><b>Ans.</b>They all must be public, and are therefore public by default.     <br /><b>8.</b>Can you inherit multiple interfaces?     <br /><b>Ans.</b>Yes.&#160; .NET does support multiple interfaces.     <br /><b>9.</b>What happens if you inherit multiple interfaces and they have conflicting method names?     <br /><b>Ans.</b>It&#8217;s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you&#8217;re okay.&#160; <br /><b>10.</b>What&#8217;s the difference between an interface and abstract class?     <br /><b>Ans.</b>In an interface class, all methods are abstract &#8211; there is no implementation.&#160; In an abstract class some methods can be concrete.&#160; In an interface class, no accessibility modifiers are allowed.&#160; An abstract class may have accessibility modifiers.     <br /><b>11.</b>What is the difference between a Struct and a Class?     <br /><b>Ans.</b>Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval.&#160; Another difference is that structs cannot inherit.     </p>
<p> <b></b>
<p><b>Method and Property Questions</b>     <br /><b>1.</b>What&#8217;s the implicit name of the parameter that gets passed into the set method/property of a class?     <br /><b>Ans.</b>Value.&#160; The data type of the value parameter is defined by whatever data type the property is declared as.     <br /><b>2.</b>What does the keyword &quot;virtual&quot; declare for a method or property?     <br /><b>Ans.</b>The method or property can be overridden.     <br /><b>3.</b>How is method overriding different from method overloading?     <br /><b>Ans.</b>When overriding a method, you change the behavior of the method for the derived class.&#160; Overloading a method simply involves having another method with the same name within the class.     <br /><b>4.</b>Can you declare an override method to be static if the original method is not static?     <br /><b>Ans.</b>No.&#160; The signature of the virtual method must remain the same.&#160; (Note: Only the keyword virtual is changed to keyword override)     <br /><b>5.</b>What are the different ways a method can be overloaded?     <br /><b>Ans.</b>Different parameter data types, different number of parameters, different order of parameters.     <br /><b>6.</b>If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors;can you enforce a call from an inherited constructor to a specific base constructor?     <br /><b>Ans.</b> Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.     <br /><b></b></p>
<p><b>Events and Delegates</b>     <br /><b>1.</b>What&#8217;s a delegate?     <br /><b>Ans.</b>A delegate object encapsulates a reference to a method.     <br /><b>2.</b>What&#8217;s a multicast delegate?     <br /><b>Ans.</b>A delegate that has multiple handlers assigned to it.&#160; Each assigned handler (method)&#160; </p>
<div class="simplesocialbuttons">
<div class="simplesocialbutton ssb-button-googleplus"><!-- Google Plus One--><g:plusone size="medium" count="true" href="http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/"></g:plusone></div>
<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><fb:like href="http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/" send="false" layout="button_count" width="100" show_faces="false" action="like" font=""></fb:like></div>
<div class="simplesocialbutton ssb-buttom-twitter"><!-- Twitter--><a name="twitter_share" data-count="horizontal" href="http://twitter.com/share" data-text="C# OOPS Interview Questions" data-url="http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/" class="twitter-share-button" rel="nofollow"></a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ms.oyangudi.com/blog/interview-questions-c-oops/c-oops-interview-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

