What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-20 01:25:05
inheritance vs composition
Inheritance should only be used when: Both classes are in the same logical domain The subclass is a proper subtype of the superclass The superclass’s implementation is necessary or appropriate for the subclass The enhancements made by the s... Add solution -
Other 2022-03-05 12:05:02
overloading vs overriding
Method Overloading Method overloading is providing two separate methods in a class with the same name but different arguments, while the method return type may or may not be different, which allows us to reuse the same method name. 1) Method Overloadin... Add solution -
Java 2021-10-25 03:19:08
difference between overloading and overriding in java
Method Overloading Method overloading is providing two separate methods in a class with the same name but different arguments, while the method return type may or may not be different, which allows us to reuse the same method name. 1) Method Overloadin... Add solution -
Javascript 2021-10-09 14:10:10
javascript class inheritance
// Class Inheritance in JavaScript class Mammal { constructor(name) { this.name = name; } eats() { return `${this.name} eats Food`; } } class Dog extends Mammal { constructor(name, owner) { super(name); this.owner = owner; } eats() { ret... Add solution