logo

Crowdly

Browser

Add to Chrome

Проаналізуйте наведений код. interface Interface {int Method(); } class Cl...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Проаналізуйте наведений код.

interface Interface {int Method(); }

class Class1: Interface

{ int len;

public Class1 (int l) {len = l; }

public int Метод() {return len * len; }

}

class Class2: Class1

{ int w, h;

public Class2 (int w1, int h1): base (w1) {w = w1; h = h1; }

new public int Метод() {return w * h; }

}

class Test

{ рublic static void Main ()

{Class2 obj1 = new Class2 (5, 10);

Interface obj2 = obj1;

System.Console.WriteLine ( "значення1 = {0} значення2 = {1}",

obj1.Method(), obj2.Method());

}}

Вкажіть результат виведення на консоль після спроби запустити програму на компіляцію і виконання:

C# oop_class

More questions like this

Want instant access to all verified answers on moodle.chnu.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome