What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-18 18:05:10
how to set class attributes with kwargs python
# In parent Class def __init__(self, attributes): for key, value in attributes.items(): self.__dict__[key] = value # In child Class def __init__(self, **kwargs): attributes = {k:v for k,v in kwargs.items() if v} super().__init__(attributes) Add solution -
Java 2022-02-09 12:35:24
java equal method
In general both equals() and == operator in Java are used to compare objects to check equality but here are some of the differences between the two: 1) .equals() and == is that one is a method and other is operator. 2) We can use == operator for referen... Add solution -
Javascript 2022-02-01 22:10:41
extended class call method from super in javascript
class Rectangle { constructor(height, width) { this.name = 'Rectangle'; this.height = height; this.width = width; } sayName() { console.log('Hi, I am a ', this.name + '.'); } get area() { return this.height * this.width; } ... Add solution -
Java 2022-02-01 08:51:29
polymorphism in java
POLYMORPHISM: It is an ability of object to behave in multiple form. The most common use of polymorphism is Java, when a parent class reference type of variable is used to refer to a child class object. In my framework E.g.: WebDriver driver = new Chrom... Add solution -
Other 2022-01-30 18:51:52
oops concepts
OOP focuses on the objects that are required to be manipulated instead of logic. - It makes development and maintenance easier - It provides data hiding - It provides ability to simulate real-world - less memory and organized - reusable OOP language fol... Add solution -
Java 2022-01-23 02:01:30
Difference between == operator and equals method in java
In general both equals() and == operator in Java are used to compare objects to check equality but here are some of the differences between the two: 1) .equals() and == is that one is a method and other is operator. 2) We can use == operator for referen... Add solution -
Java 2021-11-22 11:21:37
what is method overriding in java
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. Method overriding means defining a method... Add solution -
Java 2021-11-22 11:21:37
what is method overriding in java
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. Method overriding means defining a method... Add solution