C#
Which of t ...
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
Which of the following statements about inheritance in C# are correct?
Class cannot inherit from implementation
Class can inherit from only one implementation
Class can inherit from any number of implementations
Class cannot inherit from interface
Class can inherit from only one interface at most
Class can inherit from unlimited number of interfaces
Explanation
Get an explanation when it's available:
Subscribe
inheritance
interface
-2
(2)
Like
Login in
to like
Comment
Login in
to comment
Share
Tweet
Related Content
Какое значение будет выведено на консоль в результате выполнения программы? struct A { public virtual void foo() { Console.WriteLine("A"); } } struct B : A { public virtual override void foo() { Console.WriteLine("B"); } } class Program { static void Main(string[] args) { A v = new B(); v.foo(); } }
Укажите отличия интерфейса от абстрактного класса
Укажите имя класса, от которого наследуются все исключения.
Объявлена структура struct MyStruct { public int x; public int y; } Возможен ли такой код: class MyClass : MyStruct { }
Что будет напечатано в результате выполнения следующего кода? class Program { class A { public virtual void Print() { Console.WriteLine("A::Print"); } } class B : A { public override void Print() { Console.WriteLine("B::Print"); } } class C : B { public new void Print() { base.Print(); Console.WriteLine("C::Print"); } } static void Main(string[] args) { A a = new A(); A b = new B(); A c = new C(); a.Print(); b.Print(); c.Print(); Console.ReadKey(); } }
C
#
Quiz
Login to learn C#
or
Read more about
C# Quizzes
Follow CodeGalaxy
Mobile Beta
Send Feedback
Keep exploring
C# quizzes
Лямбда-выражения на платформе .Net могут существовать в виде:
Скомпилируется ли данный фрагмент кода успешно? private int GetID (string inputText) { if (inputText != "") return 1; else if (inputText == "") return 0; }
Для чего предназначен метод Finalize?
Поддерживает ли С# перегрузку методов на основе возвращаемого значения?
public abstract class A { public virtual string Print() { return "A"; } } public class B : A { public override new string Print() { return "B"; } } public class C : B { public string Print() { return "C"; } } Каков будет результат при выполнении следующего кода: A ac = new C(); Console.WriteLine(ac.Print());
Какие из перечисленных ключевых слов используются в конструкции "если":
Sign Up Now
or
Subscribe for future quizzes
Login in to like
Login in to comment