Browse Source

Praktikum 17.10.2023 first commit

master
Armin Wach 1 year ago
parent
commit
94c0c19c33

+ 3
- 0
Test/praktikum01/ZahlenfilterTest.java View File

@@ -18,10 +18,13 @@ class ZahlenfilterTest {

@Test
void checkEndsWith9() {
assertTrue(Zahlenfilter.checkEndsWith9(9));
assertFalse(Zahlenfilter.checkEndsWith9(6));

}

@Test
void checkSumDivisibleBy3() {

}
}

+ 1
- 1
src/praktikum01/ErrorWriter.java View File

@@ -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");

+ 12
- 3
src/praktikum01/Executor.java View File

@@ -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();

}
}

src/praktikum01/HelloWorldTest.java → src/praktikum01/HelloWorld.java View File

@@ -1,6 +1,6 @@
package praktikum01;

public interface HelloWorldTest {
public interface HelloWorld {
void writeHelloWorld();

}

+ 1
- 1
src/praktikum01/OutWriter.java View File

@@ -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…
Cancel
Save