473,406 Members | 2,894 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,406 software developers and data experts.

Equivalent C# keyword

Hi,
Just curious to know if there's a keyword equivalent to "Myclass" in VB.Net
in C#

TIA
Krishnan
Nov 20 '05 #1
7 3780
I think its 'base'

Me == this
MyClass == base
Krishnan wrote:
Hi,
Just curious to know if there's a keyword equivalent to "Myclass" in VB.Net
in C#

TIA
Krishnan


Nov 20 '05 #2
Hi Harvey,
Thanks for your reply. Am sorry, but, I don't believe that to be the case. I
have tried to explain this with an example:

[VB.Net code]
Module Module1

Sub Main()

Dim b As Base

b = New Derived1

b.Test()

End Sub

End Module

Class Base

Public Sub Test()

Me.Foo()

MyClass.Foo()

End Sub

Public Overridable Sub Foo()

Console.WriteLine("Base - Foo")

End Sub

End Class

Class Derived1

Inherits Base

Public Overrides Sub Foo()

Console.WriteLine("Derived1 - Foo")

End Sub

End Class

Output:
=====
Derived1 - Foo
Base - Foo
In other words, MyClass makes the call to the function always on the "same"
class ireespective of the inheritance chain, wihle the rule in inheritance
is to call the "most" derived form of the method(as is done by the line
Me.Foo(). Please let me know if you think that this scenario can be
simulated in C#, and if so how. I'd be grateful if you can post your code
snippet here.

TIA
Krishnan

"Harvey Green" <no****@somewhere.com> wrote in message
news:Op**************@TK2MSFTNGP09.phx.gbl...
I think its 'base'

Me == this
MyClass == base
Krishnan wrote:
Hi,
Just curious to know if there's a keyword equivalent to "Myclass" in VB.Net in C#

TIA
Krishnan

Nov 20 '05 #3
Hi Krishnan,

huh, I don't think that C# has an equivalent.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Krishnan" <kr*********************@myrealbox.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,
Just curious to know if there's a keyword equivalent to "Myclass" in VB.Net in C#

TIA
Krishnan

Nov 20 '05 #4
Krishian,

There is no equivalent to it in c#.

Klaus

"Krishnan" <kr*********************@myrealbox.com> schrieb im Newsbeitrag
news:uv**************@TK2MSFTNGP10.phx.gbl...
Hi Harvey,
Thanks for your reply. Am sorry, but, I don't believe that to be the case. I have tried to explain this with an example:

[VB.Net code]
Module Module1

Sub Main()

Dim b As Base

b = New Derived1

b.Test()

End Sub

End Module

Class Base

Public Sub Test()

Me.Foo()

MyClass.Foo()

End Sub

Public Overridable Sub Foo()

Console.WriteLine("Base - Foo")

End Sub

End Class

Class Derived1

Inherits Base

Public Overrides Sub Foo()

Console.WriteLine("Derived1 - Foo")

End Sub

End Class

Output:
=====
Derived1 - Foo
Base - Foo
In other words, MyClass makes the call to the function always on the "same" class ireespective of the inheritance chain, wihle the rule in inheritance
is to call the "most" derived form of the method(as is done by the line
Me.Foo(). Please let me know if you think that this scenario can be
simulated in C#, and if so how. I'd be grateful if you can post your code
snippet here.

TIA
Krishnan

"Harvey Green" <no****@somewhere.com> wrote in message
news:Op**************@TK2MSFTNGP09.phx.gbl...
I think its 'base'

Me == this
MyClass == base
Krishnan wrote:
Hi,
Just curious to know if there's a keyword equivalent to "Myclass" in VB.Net in C#

TIA
Krishnan


Nov 20 '05 #5
Thanks Klaus & Miha.

Krishnan

"Klaus Löffelmann" <fo***********@loeffelmann.de> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
Krishian,

There is no equivalent to it in c#.

Klaus

"Krishnan" <kr*********************@myrealbox.com> schrieb im Newsbeitrag
news:uv**************@TK2MSFTNGP10.phx.gbl...
Hi Harvey,
Thanks for your reply. Am sorry, but, I don't believe that to be the case.
I
have tried to explain this with an example:

[VB.Net code]
Module Module1

Sub Main()

Dim b As Base

b = New Derived1

b.Test()

End Sub

End Module

Class Base

Public Sub Test()

Me.Foo()

MyClass.Foo()

End Sub

Public Overridable Sub Foo()

Console.WriteLine("Base - Foo")

End Sub

End Class

Class Derived1

Inherits Base

Public Overrides Sub Foo()

Console.WriteLine("Derived1 - Foo")

End Sub

End Class

Output:
=====
Derived1 - Foo
Base - Foo
In other words, MyClass makes the call to the function always on the

"same"
class ireespective of the inheritance chain, wihle the rule in

inheritance is to call the "most" derived form of the method(as is done by the line
Me.Foo(). Please let me know if you think that this scenario can be
simulated in C#, and if so how. I'd be grateful if you can post your code snippet here.

TIA
Krishnan

"Harvey Green" <no****@somewhere.com> wrote in message
news:Op**************@TK2MSFTNGP09.phx.gbl...
I think its 'base'

Me == this
MyClass == base
Krishnan wrote:
> Hi,
> Just curious to know if there's a keyword equivalent to "Myclass" in

VB.Net
> in C#
>
> TIA
> Krishnan
>
>



Nov 20 '05 #6
* Harvey Green <no****@somewhere.com> scripsit:
Me == this
MyClass == base


'base' <=> 'MyBase'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
* "Krishnan" <kr*********************@myrealbox.com> scripsit:
Just curious to know if there's a keyword equivalent to "Myclass" in VB.Net
in C#


n/a.

<http://msdn.microsoft.com/library/en-us/vsintro7/html/vxoriLanguageEquivalentsKeywords.asp>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8

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

Similar topics

3
by: Phil Powell | last post by:
<?php class SuperClass { var $mySuperClassVar; function SuperClass($myVar) { $this->mySuperClassVar = $myVar; echo "super class var = $myVar<p>"; }
9
by: Krishnan | last post by:
Hi, Just curious to know if there's a keyword equivalent to "Myclass" in VB.Net in C# TIA Krishnan
8
by: FDude | last post by:
In otherwords, how do I force a method in my class to call the method implementations in the SAME class and not use any potentially overriden methods in derived classes?
9
by: Chazza | last post by:
I would like to override a method from an inherited class, but the new method has a different signature to the inherited class. Example: class A { private void Init() { // code } } class B...
5
by: tlemcenvisit | last post by:
Hello in C# : Partial type definitions allow the definition of a class, struct or interface to be split into multiple files. I'd like to have the equivalent keyword of partial in VC++ does...
10
by: Bishoy | last post by:
Hi, In VB.NET there is a keyword called "My" which has a lot of properties collected at it. Is there any equivalent to this "My" in C#? Thank you.
12
by: rodchar | last post by:
hey all, vb has a static keyword for variables, what is charp's equivalent,please? static tempVar as String thanks, rodchar
1
by: trialproduct2004 | last post by:
Hi all, can any one tell me use of shadow keyword in vb.net and its equivalent in c# with e.g. Please help me. thanks in advance.
15
by: tereglow | last post by:
Hello all, I come from a shell/perl background and have just to learn python. To start with, I'm trying to obtain system information from a Linux server using the /proc FS. For example, in...
3
by: Friedman, Jason | last post by:
I have lines that look like this: select column1, 'select' as type from table where column2 = 'foo' I want to return: SELECT column1, 'select' AS type FROM table WHERE column2 = 'foo'
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.