What happens if you inherit multiple interfaces and they have conflicting method names?

1 Answer

Answer :

It’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’re okay. To Do: Investigate 

Related questions

Description : What happens if you inherit multiple interfaces and they have conflicting method names?

Last Answer : It’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’re okay.  To Do: Investigate 

Description : Can you inherit multiple interfaces?

Last Answer : Yes. .NET does support multiple interfaces. 

Description : Can you inherit from multiple interfaces?

Last Answer : Yes

Description : Can you inherit multiple interfaces?

Last Answer : Yes. .NET does support multiple interfaces.

Description : Can you inherit multiple interfaces? 

Last Answer : Yes, why not. 

Description : What is the syntax to inherit from a class in C#? 

Last Answer : Place a colon and then the name of the base class. Example: class MyNewClass : MyBaseClass

Description : What is the syntax to inherit from a class in C#? 

Last Answer : Place a colon and then the name of the base class. Example: class MyNewClass : MyBaseClass

Description : When you inherit a protected class-level variable, who is it available to? 

Last Answer : Classes in the same namespace. 

Description : How do you inherit from a class in C#?

Last Answer : Place a colon and then the name of the base class. 

Description : Define what is the syntax to inherit from a class in C#?

Last Answer : When a class is derived from another class, then the members of the base class become the members of the derived class. The access modifier used while accessing members of the base class specifies ... syntax to inherit a class from another class In C# is as follows: class MyNewClass : MyBaseClass

Description : Write some code using interfaces, virtual methods, and an abstract class.

Last Answer : using System; public interface Iexample1 { int MyMethod1(); } public interface Iexample2 { int MyMethod2(); } public abstract class ABSExample : Iexample1, Iexample2 { public ABSExample( ... override void VIRTMethod2() { System.Console.WriteLine("VIRTMethod2 has been overridden"); } }

Description : Which of the following is/are correct with reference to Abstract class and interface ? (a) A class can inherit only one Abstract class but may inherit several interfaces. (b) An Abstract class can provide complete and default ... true (C) Both (a) and (b) are true (D) Neither (a) nor (b) is true

Last Answer : Answer: C

Description : Can multiple catch blocks be executed?

Last Answer : No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block. 

Description : Can you store multiple data types in System.Array?

Last Answer : No. 

Description : Can multiple catch blocks be executed for a single try statement?

Last Answer : No. Once the proper catch block processed, control is transferred to the finally block (if there are any). 

Description : Can you store multiple data types in System.Array?

Last Answer : No.

Description : Does C# support multiple-inheritance?

Last Answer : No. 

Description : Does C# supports multiple inheritance? 

Last Answer : No

Description : Can you increment multiple variables in a for loop control?

Last Answer : Yes – e.g. for (int i = 1; j = 2;i

Description : Can C# have multiple catch blocks?

Last Answer : Yes

Description : Can multiple catch blocks be executed for a single try statement?

Last Answer : No. Once the proper catch block processed, control is transferred to the finally block (if there are any).

Description : Can you store multiple data types in System.Array?

Last Answer : No.

Description : Does C# support multiple-inheritance?

Last Answer : No.

Description : Does C# support multiple inheritance? 

Last Answer : No, use interfaces instead.

Description : Can a class or a struct have multiple constructors?

Last Answer : Yes, a class or a struct can have multiple constructors. Constructors in C# can be overloaded.

Description : Can we execute multiple catch blocks in C#?

Last Answer : No. Once an exception has occurred it executes specific exception catch block and the control comes out.

Description : How do you enable your application to use .NET base class library members without referencing their fully qualified names?

Last Answer : Use the Imports keyword (Visual Basic .NET) or the using keyword (Visual C#) to make a .NET Framework namespace visible to your application. 

Description : What are the names of the three types of operators? 

Last Answer : Unary, binary, and conversion. 

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : What happens in memory when you Box and Unbox a value-type?

Last Answer : Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

Description : What happens if you make a property static?

Last Answer : They become class properties. 

Description : What happens in memory when you Box and Unbox a value-type?

Last Answer : Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

Description : Explain how to use the Begin and End methods on a Web Service to make an asynchronous method call.

Last Answer : Every public Web method on a Web Service can be called either synchronously or asynchronously. To make an asynchronous call to a Web method, you call the method named Begin, where is the name of ... returned by Begin. This will allow you to retrieve the actual data returned by the Web method.

Description : What is method overloading, and when is it useful?

Last Answer : Method overloading allows you to create several methods with the same name but different signatures. Overloading is useful when you want to provide the same or similar functionality to different sets of parameters.

Description : What does the Dispose method do with the connection object? 

Last Answer : Deletes it from the memory. To Do: answer better. The current answer is not entirely correct.

Description : What does assert() method do?

Last Answer : In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true. 

Description : What are the different ways a method can be overloaded?

Last Answer : Different parameter data types, different number of parameters, different order of parameters.

Description : Can you declare an override method to be static if the original method is not static? 

Last Answer : No. The signature of the virtual method must remain the same. (Note: Only the keyword virtual is changed to keyword override)

Description : How is method overriding different from method overloading? 

Last Answer : When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class.

Description : What does the keyword “virtual” declare for a method or property? 

Last Answer : The method or property can be overridden. 

Description : What’s the implicit name of the parameter that gets passed into the set method/property of a class?

Last Answer : Value. The data type of the value parameter is defined by whatever data type the property is declared as.

Description : Can you allow a class to be inherited, but prevent the method from being over-ridden?

Last Answer : Yes. Just leave the class public and make the method sealed. 

Description : Are value types are slower to pass as method parameters? 

Last Answer : Yes

Description : What is an overloaded method?

Last Answer : An overloaded method has multiple signatures that are different. 

Description : Write code to show how a method can accept a varying number of parameters.

Last Answer : using System; namespace Console1 { class Class1 { static void Main(string[] args) { ParamsMethod(1,"example"); ParamsMethod(1,2,3,4); Console.ReadLine(); } static void ... o in list) { Console.WriteLine(o.ToString()); } } } }

Description : Methods must declare a return type, what is the keyword used when nothing is returned from the method?

Last Answer : void 

Description : What does the Dispose method do with the connection object? 

Last Answer : Deletes it from the memory. To Do: answer better. The current answer is not entirely correct.

Description : What does assert() method do? 

Last Answer : In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true. 

Description : What are the different ways a method can be overloaded?

Last Answer : Different parameter data types, different number of parameters, different order of parameters.