CJCoding With Joseph
15free / daySign inCreate account
TitleTopicsAction
641
Override a Virtual MethodThe base class `Animal` has a `virtual` method `Speak`. Override it in the `Dog`...
easy○ Not Started
Polymorphism
Solve
642
Two Overloaded Print MethodsThe `Printer` class already has a `Print(int)` method. Add a second `Print` meth...
easy○ Not Started
Polymorphism
Solve
643
Overload Add By ArityThe `Calculator` class has an `Add` method that sums two `int` values. Add an ov...
easy○ Not Started
Polymorphism
Solve
644
ToString Override for PointOverride the `ToString` method on the `Point` class so printing a point shows it...
easy○ Not Started
Polymorphism
Solve
645
Implement an Abstract MethodThe `abstract` class `Shape` declares an abstract method `Area` with no body. Pr...
easy○ Not Started
Polymorphism
Solve
646
Implement an InterfaceThe interface `IGreeter` declares a method `Greet` that returns a `string`. Make...
easy○ Not Started
Polymorphism
Solve
647
Virtual Property OverrideThe base class `Employee` has a `virtual` read-only property `Role` that returns...
easy○ Not Started
Polymorphism
Solve
648
Call Base Method in OverrideThe base class `Logger` has a `virtual` method `Log` that prints `Base log`. Ove...
easy○ Not Started
Polymorphism
Solve
649
Sealed OverrideThe base class `Widget` has a `virtual` method `Draw`. In the `Button` class, pr...
easy○ Not Started
Polymorphism
Solve
650
Overload By Parameter TypeThe `Formatter` class has a `Show(int)` method. Add an overload `Show(double)` s...
easy○ Not Started
Polymorphism
Solve
651
Interface PropertyThe interface `IProduct` declares a read-only `Name` property. Make the `Book` c...
easy○ Not Started
Polymorphism
Solve
652
Polymorphic Method ParameterThe `Speaker` class has a method `Announce(Animal a)`. Because the parameter typ...
easy○ Not Started
Polymorphism
Solve
653
Abstract Property ImplementThe `abstract` class `Animal` declares an abstract read-only property `Sound`. I...
easy○ Not Started
Polymorphism
Solve
666
Override a Calculated ResultThe base class `Shape` has a `virtual` method `Area()` that returns `0`. Overrid...
easy○ Not Started
Polymorphism
Solve
667
Extend the Base Method with baseThe base class `Greeter` has a `virtual` method `Greet()` that returns `Hello`. ...
easy○ Not Started
Polymorphism
Solve
668
Overload a Method by Argument CountMethod overloading (compile-time polymorphism) lets one method name have several...
easy○ Not Started
Polymorphism
Solve
669
Overload a Method by Parameter TypeOverloads can also differ by parameter type. The `Printer` class already has `De...
easy○ Not Started
Polymorphism
Solve
670
Polymorphic ToString`Console.WriteLine` on an object calls that object's `ToString()`, and the objec...
easy○ Not Started
Polymorphism
Solve
671
Implement an Interface MethodAn interface lists methods a class promises to provide. The `IShape` interface d...
easy○ Not Started
Polymorphism
Solve
672
Override a Virtual PropertyProperties can be `virtual` and overridden just like methods. The `Vehicle` clas...
easy○ Not Started
Polymorphism
Solve
673
One Method, Many AnimalsA method that takes a base-class parameter can accept ANY derived object. The `A...
easy○ Not Started
Polymorphism
Solve
674
Override a Void MethodOverriding also works for methods that return nothing. The `Logger` class has a ...
easy○ Not Started
Polymorphism
Solve
675
Implement an Abstract PropertyAbstract classes can declare abstract properties that each derived class must fi...
easy○ Not Started
Polymorphism
Solve
782
Override Equals for Value EqualityOverride the inherited `Equals(object? obj)` method on `Point` so two points are...
easy○ Not Started
Polymorphism
Solve
783
Chain to the Base Constructor`Vehicle` has a constructor that takes a `make` and stores it in `Make`. Complet...
easy○ Not Started
Polymorphism
Solve
654
Polymorphic List TotalComplete `AreaCalculator.TotalArea` so it returns the sum of `Area()` for every ...
medium○ Not Started
Polymorphism
Solve
655
Operator OverloadingOverload the `+` operator on the `Vector` class so adding two vectors adds their...
medium○ Not Started
Polymorphism
Solve
656
Iterate Interface ImplementersThe interface `IShape` is implemented by `Circle` and `Triangle`, each returning...
medium○ Not Started
Polymorphism
Solve
657
Classify By Runtime TypeComplete `Classifier.Classify` so it returns `Dog`, `Cat`, or `Unknown` dependin...
medium○ Not Started
Polymorphism
Solve
658
Generic Max MethodComplete the generic method `Max<T>` so it returns the larger of two values of A...
medium○ Not Started
Polymorphism
Solve
659
Implement Two InterfacesA class can implement more than one interface. Make `Duck` implement BOTH `IWalk...
medium○ Not Started
Polymorphism
Solve
660
Abstract Template MethodThe `abstract` class `Shape` has a concrete `Report()` method that combines two ...
medium○ Not Started
Polymorphism
Solve
661
Implement IComparableMake `Person` implement `IComparable<Person>` by ordering people by `Age` ascend...
medium○ Not Started
Polymorphism
Solve
676
Loop Over a Base-Type ArrayThe abstract class `Animal` declares `abstract string Sound()`. Create a `Dog` c...
medium○ Not Started
Polymorphism
Solve
677
Hide a Method with newThe `new` keyword HIDES an inherited method instead of overriding it. With hidin...
medium○ Not Started
Polymorphism
Solve
678
Safe Downcast with Pattern MatchingSometimes you must check an object's real type before using a method only the de...
medium○ Not Started
Polymorphism
Solve
679
Sum Areas Through an InterfaceThe `IShape` interface declares `int Area()`. Create a `Rectangle` class (constr...
medium○ Not Started
Polymorphism
Solve
680
Template Method Calls a VirtualA non-virtual base method can call a `virtual` method, and overriding that virtu...
medium○ Not Started
Polymorphism
Solve
681
Chained Overrides Across Three LevelsOverrides can build on each other level by level using `base`. `A.Name()` return...
medium○ Not Started
Polymorphism
Solve
682
Program to an InterfaceA method that accepts an interface type works with any class that implements it....
medium○ Not Started
Polymorphism
Solve
683
Polymorphic Factory From InputA factory method can return different subclasses through the same base type, cho...
medium○ Not Started
Polymorphism
Solve
784
Default Interface MethodGive the `IGreeter` interface a default method `Greet()` that returns the text `...
medium○ Not Started
Polymorphism
Solve
662
Build a Shape HierarchyBuild a polymorphic shape hierarchy from scratch. Define an `abstract` class `Sh...
hard○ Not Started
Polymorphism
Solve
663
Discount StrategiesBuild an interface-based strategy from scratch. Define an interface `IDiscount` ...
hard○ Not Started
Polymorphism
Solve
664
Money With Operator PlusBuild a `Money` class that supports the `+` operator. It stores whole `Dollars` ...
hard○ Not Started
Polymorphism
Solve
665
Polymorphic PayrollBuild a payroll hierarchy from scratch. Define an `abstract` class `Employee` wi...
hard○ Not Started
Polymorphism
Solve
684
Explicit Interface ImplementationWhen two interfaces declare a method with the SAME name, a class can implement e...
hard○ Not Started
Polymorphism
Solve
685
Generic Method (Parametric Polymorphism)Generics let one method work with ANY type. Write a generic method `Identity<T>`...
hard○ Not Started
Polymorphism
Solve
686
Generic Container ClassA generic class is a single class definition that adapts to whatever type you pl...
hard○ Not Started
Polymorphism
Solve
785
Covariant Return Type Override`Animal` declares a virtual `Clone()` that returns an `Animal`, and a virtual `S...
hard○ Not Started
Polymorphism
Solve