Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Practicing Inheritance | OOP Principles
C# Beyond Basics

bookPracticing Inheritance

Fill in the blanks to make sure the base constructors are properly called in the following code:

index.cs

index.cs

copy
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
using System; class Animal { string species; public Animal(string species) { this.species = species; } public void Eat() { Console.WriteLine("The animal is eating."); } } class Dog : Animal { string breed; public Dog(string species, string breed) : ___ { this.breed = breed; } public void Bark() { Console.WriteLine("Woof! Woof!"); } } class GermanShepherd : Dog { public GermanShepherd(string species, string breed) : ___ { Console.WriteLine("GermanShepherd Object Created"); } public void PerformGuardDuty() { Console.WriteLine("The German Shepherd is performing guard duty."); } } class ConsoleApp { static void Main() { new GermanShepherd("Canis lupus familiaris", "German Shepherd"); } }

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 5. Capítulo 3

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Awesome!

Completion rate improved to 2.04

bookPracticing Inheritance

Desliza para mostrar el menú

Fill in the blanks to make sure the base constructors are properly called in the following code:

index.cs

index.cs

copy
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
using System; class Animal { string species; public Animal(string species) { this.species = species; } public void Eat() { Console.WriteLine("The animal is eating."); } } class Dog : Animal { string breed; public Dog(string species, string breed) : ___ { this.breed = breed; } public void Bark() { Console.WriteLine("Woof! Woof!"); } } class GermanShepherd : Dog { public GermanShepherd(string species, string breed) : ___ { Console.WriteLine("GermanShepherd Object Created"); } public void PerformGuardDuty() { Console.WriteLine("The German Shepherd is performing guard duty."); } } class ConsoleApp { static void Main() { new GermanShepherd("Canis lupus familiaris", "German Shepherd"); } }

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 5. Capítulo 3
some-alt