method-hiding Questions

8

Solved

Javadoc says: the version of the hidden method that gets invoked is the one in the superclass, and the version of the overridden method that gets invoked is the one in the subclass. doesn't ri...
Victorvictoria asked 1/5, 2013 at 6:21

11

Solved

What are differences between declaring a method in a base type "virtual" and then overriding it in a child type using the "override" keyword as opposed to simply using the "new" keyword when declar...
Banquet asked 1/10, 2008 at 22:6

17

Solved

I'm confused on how overriding differs from hiding in Java. Can anyone provide more details on how these differ? I read the Java Tutorial but the sample code still left me confused. To be more cle...
Contrasty asked 15/5, 2012 at 4:12

2

Solved

I couldn't find a question like mine, so I hope it's not a duplicate one. Again it's about overriding and hiding. I think - but I might be wrong - I understood both. The following code behaves as...
Disputant asked 3/2, 2016 at 13:56

1

Solved

I've just learned that in Java there is a distinction between overriding and hiding (static methods are hidden not overriden) which implies that Java uses both early and late binding. Is there so...
Michaelemichaelina asked 2/9, 2015 at 16:36

5

Solved

Given the following code fragment, what are the differences in the function calls? What is function hiding? What is function overriding? How do they relate to function overloads? What is the differ...
Leffert asked 1/11, 2013 at 22:15

4

Solved

If I have something like this: class Base { public void Write() { if (this is Derived) { this.Name();//calls Name Method of Base class i.e. prints Base ((Derived)this).Name();//calls Derived...
Afterward asked 24/4, 2015 at 22:0

8

Solved

Consider this code: internal class Program { private static void Main(string[] args) { var student = new Student(); student.ShowInfo(); //output --> "I am Student" } } public class Per...
Ex asked 27/7, 2013 at 12:46

1

Possible Duplicate: method hiding in c# with a valid example .why is it implemented in the framework.? what is the Real world advantage.? I am wondering how method hiding could be use...
Gilthead asked 22/1, 2013 at 15:10

9

Per MSDN, the "new" keyword when used for method hiding only suppresses a warning. http://msdn.microsoft.com/en-us/library/435f1dw2.aspx Do I really need this "new" keyword to perform method hid...
Readus asked 23/7, 2009 at 7:20

5

Solved

What is the difference between method hiding and shadowing in C#? Are they same or different? Can we call them as polymorphism (compile time or run time)?
Icecold asked 1/3, 2012 at 16:38

2

Solved

Possible Duplicate: Why doesn't Java allow overriding of static methods? Is there any legitimate reason why one would want a derived class to override hide a static method of the ...
Trollope asked 23/9, 2011 at 4:24

3

Solved

I've read the Overriding and Hiding Methods tutorial. And from that, I gathered the following: If a subclass defines a class method with the same signature as a class method in the superclass, ...
Anemograph asked 14/9, 2011 at 17:7

3

Solved

I am a bit confused about overriding vs. hiding a method in C#. Practical uses of each would also be appreciated, as well as an explanation for when one would use each. I am confused about o...
Deplume asked 1/10, 2010 at 11:3

4

Solved

The following program prints A:C(A,B) B:C(A,B) (as it should) public interface I { string A(); } public class C : I { public string A() { return "A"; } public string B() { return "B";...
Strickle asked 2/4, 2009 at 16:18

5

Solved

Why the following program prints B B (as it should) public class A { public void Print() { Console.WriteLine("A"); } } public class B : A { public new void Print() { Console.WriteLi...
Anatol asked 2/4, 2009 at 13:34
1

© 2022 - 2024 — McMap. All rights reserved.