Skip to content
Snippets Groups Projects
Commit 2f068369 authored by Peter Hertkorn's avatar Peter Hertkorn
Browse files

Add aliens and simulator; update gitignore

parent 52a9d37b
No related branches found
No related tags found
No related merge requests found
HELP.md
target/
out/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
......
package aliensimulator;
public abstract class Alien {
public abstract void darstellen();
public void fliegen() {
System.out.println("Ich fliege durch den Weltraum.");
}
}
package aliensimulator;
public class AlienMars extends Alien {
public void darstellen() {
System.out.println("Ich bin das Alien vom Mars.");
}
}
package aliensimulator;
public class AlienMond extends Alien {
public void darstellen() {
System.out.println("Ich bin das Alien vom Mond.");
}
}
package aliensimulator;
public class AlienSimulator {
public static void main(String[] args) {
Alien alien = new AlienMars();
alien.darstellen();
alien.fliegen();
alien = new AlienMond();
alien.darstellen();
alien.fliegen();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment