Format active object README.md to display correctly on the web site
This commit is contained in:
parent
74abc7a0d6
commit
77ffae5ecc
@ -79,12 +79,12 @@ public abstract class ActiveCreature{
|
|||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
We can see that any class that will extend the ActiveCreature class will have its own thread of control to execute and invocate methods.
|
We can see that any class that will extend the ActiveCreature class will have its own thread of control to execute and invocate methods.
|
||||||
|
|
||||||
For example, the Orc class:
|
For example, the Orc class:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public class Orc extends ActiveCreature {
|
public class Orc extends ActiveCreature {
|
||||||
|
|
||||||
@ -96,6 +96,7 @@ public class Orc extends ActiveCreature {
|
|||||||
```
|
```
|
||||||
|
|
||||||
Now, we can create multiple creatures such as Orcs, tell them to eat and roam and they will execute it on their own thread of control:
|
Now, we can create multiple creatures such as Orcs, tell them to eat and roam and they will execute it on their own thread of control:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
var app = new App();
|
var app = new App();
|
||||||
@ -121,4 +122,4 @@ Now, we can create multiple creatures such as Orcs, tell them to eat and roam an
|
|||||||
|
|
||||||
## Class diagram
|
## Class diagram
|
||||||
|
|
||||||

|

|
||||||
|
Loading…
x
Reference in New Issue
Block a user