473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C# style Inheritance and Interfaces

I'm a novice programmer just beginning to learn the new C# language.

I'm a bit confused about the way Inheritance and Interfaces are constructed
in C#. The following examples may help clarify my confusion:

interface IControl

{

void Paint();

}

interface ITextBox: IControl
{
void SetText(string text);
}

public class IControl

{

void SetText(string text);

}

public class EditBox : IControl

{

public void Paint() {...}

public void Bind(Binder b) {...}

}

Can the designers of the language ponder over this and maybe think of a way
to remove this confusion in future releases of the language?

I was wondering., wouldn't it be better to use the more clearer VB-style or
Java-style methods of invoking inheritance and interface? After all this is
not the era of the criptic C++ style way of programming. I think this would
remove the confusion a great deal.

e.g.

interface ItextBox implements Icontrol {}

AND

public class EditBox inherits Icontrol {}

etc.


Nov 16 '05 #1
1 1320
"Flavian Mwasi" <f@a.com> wrote in
news:OZ**************@TK2MSFTNGP12.phx.gbl...
I'm a bit confused about the way Inheritance and Interfaces are constructed in C#.
Why, it's done exactly the same way as in VB or Java - only the syntax is
different.
I was wondering., wouldn't it be better to use the more clearer VB-style or Java-style methods of invoking inheritance and interface?
...


I'm not sure if I got you? To me this sounds like you're merely complaining
about the ":"???
Or do you want to have C# with Java syntax (then use J#)?

If you're learning C#, it's ok if you don't understand all of it's syntax
yet - but that doesn't make it cryptic.

Niki
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Steve Jorgensen | last post by:
The classing Visual Basic and VBA support for polymorphism, let's face it, is a bit on the weak side, and built-in support for inheritance is non-existent. This little essay is about some patterns...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
23
by: Dave Rahardja | last post by:
Since C++ is missing the "interface" concept present in Java, I've been using the following pattern to simulate its behavior: class Interface0 { public: virtual void fn0() = 0; };
13
by: interec | last post by:
I have some code in Java that I need to translate into C++. My Java code defines a class hierarchy as follows: // interface IA public interface IA { public abstract void doA(); } //...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.