abstraction in javascript
// Abstract class
abstract class Animal {
// Abstract method (does not have a body)
public abstract void animalSound();
// Regular method
public void sleep() {
System.out.println("Zzz");
}
}
// Subclass (inherit from Animal)
class Pig extends Animal {
public void animalSound() {
// The body of animalSound() is provided here
System.out.println("The pig says: wee wee");
}
}
class MyMainClass {
public static void main(String[] args) {
Pig myPig = new Pig(); // Create a Pig object
myPig.animalSound();
myPig.sleep();
}
}
Also in JavaScript:
- comment dire le nombre de ligne html en cliquamt sur un boutton javascript
- object find javascript
- retour à la ligne react native
- how to check if map is map javascript
- js random minus
- package json scripts multiple commands
- wait time js
- javascript group by property array of objects
- showing difference between dates in minutes js
- remove last element from array javascript
- react if statement
- how to implement a promise with daisy chaining in angular
- jQuery exclude exteranl link for images
- JavaScript append text to div
- javascript example of foreach loop
- node js to check 32 bit
- react native init project
- javascript get cpu cores
- pandas to json
- number to array javascript
- how to log all messages discord.js
- remove duplicates from array
- js array.pop
- useReactiveVar