Praktikum 17.10.2023 first commit
This commit is contained in:
parent
b47ae41985
commit
94c0c19c33
@ -18,10 +18,13 @@ class ZahlenfilterTest {
|
||||
|
||||
@Test
|
||||
void checkEndsWith9() {
|
||||
assertTrue(Zahlenfilter.checkEndsWith9(9));
|
||||
assertFalse(Zahlenfilter.checkEndsWith9(6));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void checkSumDivisibleBy3() {
|
||||
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package praktikum01;
|
||||
|
||||
public class ErrorWriter implements HelloWorldTest{
|
||||
public class ErrorWriter implements HelloWorld {
|
||||
@Override
|
||||
public void writeHelloWorld() {
|
||||
System.err.println("HELLO WORLD");
|
||||
|
@ -1,9 +1,18 @@
|
||||
package praktikum01;
|
||||
|
||||
public class Executor implements HelloWorldTest{
|
||||
public class Executor{
|
||||
|
||||
@Override
|
||||
public void printHelloWorld() {
|
||||
public static void main(String[] args) {
|
||||
|
||||
printHelloWorld(new ErrorWriter(), new OutWriter(), false);
|
||||
}
|
||||
|
||||
|
||||
public static void printHelloWorld(HelloWorld writer1, HelloWorld writer2, boolean second) {
|
||||
if (second)
|
||||
writer2.writeHelloWorld();
|
||||
else
|
||||
writer1.writeHelloWorld();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package praktikum01;
|
||||
|
||||
public interface HelloWorldTest {
|
||||
public interface HelloWorld {
|
||||
void writeHelloWorld();
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package praktikum01;
|
||||
|
||||
public class OutWriter implements HelloWorldTest{
|
||||
public class OutWriter implements HelloWorld {
|
||||
@Override
|
||||
public void writeHelloWorld() {
|
||||
System.out.println("HELLO WORLD");
|
||||
|
Loading…
x
Reference in New Issue
Block a user