how must i implement investigateWorld() ?
package de.codegym.task.task16.task1610;
/*
Aufrufe von join() ordnen
*/
public class Solution {
public static void main(String[] args) throws InterruptedException {
Cat cat1 = new Cat("Missy");
cat1.join();
Cat cat2 = new Cat("Coco");
}
private static void investigateWorld() {
}
public static class Cat extends Thread {
protected Kitten kitten1;
//kitten1.join();
protected Kitten kitten2;
public Cat(String name) {
super(name);
kitten1 = new Kitten("Kätzchen 1 (Mutter - " + getName() + ")");
kitten2 = new Kitten("Kätzchen 2 (Mutter - " + getName() + ")");
start();
}
public void run() {
System.out.println(getName() + " hat 2 Kätzchen geboren");
try {
initAllKittens();
} catch (InterruptedException e) {
}
System.out.println(getName() + ": Alle Kätzchen sind im Korb. " + getName() + " hat sie zurückgebracht");
}
private void initAllKittens() throws InterruptedException {
kitten1.start();
kitten2.start();
}
}
public static class Kitten extends Thread {
public Kitten(String name) {
super(name);
}
public void run() {
System.out.println(getName() + " ist aus dem Korb entwicht");
investigateWorld();
}
}
}