Fixed Rocket icon for "Run Code" (#26595)
This commit is contained in:
committed by
The Coding Aviator
parent
c05d680589
commit
5bf9807fce
@ -34,7 +34,7 @@ public class Car implements Vehicle {
|
||||
}
|
||||
```
|
||||
|
||||
 <a href='https://repl.it/CItd/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
 <a href='https://repl.it/CItd/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
Now, there is a **ground rule** : The Class must implement **all** of the methods in the Interface. The methods must have _the exact same_ signature (name, parameters and exceptions) as described in the interface. The class _does not_ need to declare the fields though, only the methods.
|
||||
|
||||
@ -78,7 +78,7 @@ Starter.startEngine(tesla); // starting engine ...
|
||||
Starter.startEngine(tata); // starting truck engine ...
|
||||
```
|
||||
|
||||
 <a href='https://repl.it/CItm/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
 <a href='https://repl.it/CItm/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## But how about multiple interfaces?
|
||||
|
||||
@ -107,7 +107,7 @@ public class Smartphone implements GPS,Radio {
|
||||
}
|
||||
```
|
||||
|
||||
 <a href='https://repl.it/CIto/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
 <a href='https://repl.it/CIto/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Some features of Interfaces
|
||||
|
||||
@ -157,7 +157,7 @@ Smartphone motoG = new Smartphone();
|
||||
motog.getRoughCoordinates(); // Fetching rough coordinates...
|
||||
```
|
||||
|
||||
 <a href='https://repl.it/CItp/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
 <a href='https://repl.it/CItp/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### But, what happens if two interfaces have the same method signature?
|
||||
|
||||
@ -194,7 +194,7 @@ Smartphone motoG = new Smartphone();
|
||||
motoG.next(); // Next from MusicPlayer
|
||||
```
|
||||
|
||||
 <a href='https://repl.it/CIts/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
 <a href='https://repl.it/CIts/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Static Methods in Interfaces
|
||||
|
||||
@ -225,7 +225,7 @@ class Main {
|
||||
}
|
||||
```
|
||||
|
||||
 <a href='https://repl.it/CIts/9' target='_blank' rel='nofollow'>Run Code</a>
|
||||
 <a href='https://repl.it/CIts/9' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Inheriting an Interface
|
||||
|
||||
@ -261,7 +261,7 @@ public class SmartPhone implements MusicPlayer {
|
||||
}
|
||||
```
|
||||
|
||||
 <a href='https://repl.it/CIty/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
 <a href='https://repl.it/CIty/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
Whoops, did I forget `next()` ? See, since it was a `default` method, I didn't had to provide an implementation at all. (Won't work for JDK < 8)
|
||||
|
||||
|
Reference in New Issue
Block a user