mirror of
https://github.com/UnlegitDqrk/Potato.git
synced 2025-10-02 06:30:15 +02:00
Fixed: Make Potato compilable
This commit is contained in:
@@ -1,22 +1,42 @@
|
|||||||
public class Potato
|
import java.util.List;
|
||||||
{
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public static void Main(String[] args}
|
public class Potato {
|
||||||
{
|
|
||||||
|
private final List<Condiment> condiments = new ArrayList<Condiment>();
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
Potato potato = new Potato();
|
Potato potato = new Potato();
|
||||||
potato.prepare();
|
if (potato.prepare()) System.out.println("Of course potato is prepared and delicious.");
|
||||||
|
else System.out.println("Fatal error! How could potato not be delicious?");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean prepare(Object bob)
|
public boolean prepare() {
|
||||||
{
|
this.addCondiment("sour cream");
|
||||||
Potato bob = bob;
|
this.addCondiment("chives");
|
||||||
bob.addSourCream();
|
this.addCondiment("butter");
|
||||||
bob.addChives();
|
return this.isDelicious();
|
||||||
bob.addButter();
|
}
|
||||||
|
|
||||||
if(bob.isDelicous())
|
public void addCondiment(String name) {
|
||||||
{
|
synchronized (condiments) {
|
||||||
return true;
|
condiments.add(new Condiment(name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDelicious() {
|
||||||
|
return true; // obviously, potatos are always delicious
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Condiment {
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
public Condiment(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user