Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

c# - An internal class can't be inherited by a public class

Jul 22 2011 9:21AM by Ramireddy   

Recently my colleague asked me this question, "Can a private class can be inherited by another class?" What do you think Yes? or No?

Question itself is invalid. There are no private classes in c#(Except nested classes). A class can be either public or internal only. You can't have other access modifiers.

Ok, lets convert the question now to "Can an internal class can be inherited by a public class"?

Answer : No

Class "B" can inherit from class "A", only if "A" has more or equal accessibility than "B". If class "A" is internal and class "B" is public, it means "A" has less accessbility than "B". So, "B" can't inherit from "A"

Read More..   [32134 clicks]

Published under: Microsoft .NET Tips ·  ·  ·  · 


Ramireddy
2 · 40% · 12972
3
 
5
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

4  Comments  

  • You can prepare a series on these kind of question. This will be very much interesting.

    commented on Jul 22 2011 10:39AM
    Manas Ranjan Dash
    39 · 5% · 1484
  • I will second that - a series on these basic fundamentals would be very interesting to read.

    commented on Jul 22 2011 11:13AM
    Nakul Vachhrajani
    4 · 36% · 11543
  • Thanks Manas & Nakul for your kind comments... :) I am working on this... Until that i will share daily tips here

    commented on Jul 22 2011 11:25AM
    Ramireddy
    2 · 40% · 12972
  • One of my friend was asked in an interview like 3 classes are there in 3 assembles A,B,C .Out of this B can inherit A but C can't inherit A.Can we achieve this?if YES how?

    commented on Oct 16 2012 12:54PM
    renju.y
    1592 · 0% · 12

Your Comment


Sign Up or Login to post a comment.

"c# - An internal class can't be inherited by a public class" rated 5 out of 5 by 3 readers
c# - An internal class can't be inherited by a public class , 5.0 out of 5 based on 3 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]