'Can class be empty (without any parametr) when this class extend another class?
namespace FinalExam
{
class Developer
{
string name;
public void sayGoodMorning()
{
Console.Write("Good Morning! ");
}
public void sayHi()
{
Console.WriteLine("Hi!");
}
public void startDiscussion()
{
Console.WriteLine("How is going your work?");
}
public void setName(string a)
{
name = a;
}
public void getName()
{
Console.WriteLine(name);
}
}
class BackEnd : Developer
{
}
class FrontEnd : Developer
{
}
class FrontEndBackEndTest
{
static void Main(string[] args)
{
Developer Zaur = new Developer();
Zaur.sayGoodMorning();
Console.WriteLine();
BackEnd backEnd = new BackEnd();
backEnd.setName("Ben");
backEnd.sayGoodMorning();
backEnd.getName();
Console.WriteLine();
FrontEnd frontEnd = new FrontEnd();
frontEnd.setName("Jane");
frontEnd.sayHi();
frontEnd.startDiscussion();
}
}
}
my class was like this(don't mind names or calling objects just for example) in this example must be write something in child class or can be empty?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
