diff --git a/Code/Steiner/theorieVererbung/.vscode/settings.json b/Code/Steiner/theorieVererbung/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/theorieVererbung/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/Code/Steiner/theorieVererbung/README.md b/Code/Steiner/theorieVererbung/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/theorieVererbung/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/Code/Steiner/theorieVererbung/bin/App.class b/Code/Steiner/theorieVererbung/bin/App.class new file mode 100644 index 0000000..d3dbf59 Binary files /dev/null and b/Code/Steiner/theorieVererbung/bin/App.class differ diff --git a/Code/Steiner/theorieVererbung/bin/EBike.class b/Code/Steiner/theorieVererbung/bin/EBike.class new file mode 100644 index 0000000..a1720da Binary files /dev/null and b/Code/Steiner/theorieVererbung/bin/EBike.class differ diff --git a/Code/Steiner/theorieVererbung/bin/Fahrrad.class b/Code/Steiner/theorieVererbung/bin/Fahrrad.class new file mode 100644 index 0000000..28f1b17 Binary files /dev/null and b/Code/Steiner/theorieVererbung/bin/Fahrrad.class differ diff --git a/Code/Steiner/theorieVererbung/src/App.class b/Code/Steiner/theorieVererbung/src/App.class new file mode 100644 index 0000000..029f326 Binary files /dev/null and b/Code/Steiner/theorieVererbung/src/App.class differ diff --git a/Code/Steiner/theorieVererbung/src/App.java b/Code/Steiner/theorieVererbung/src/App.java new file mode 100644 index 0000000..d60e820 --- /dev/null +++ b/Code/Steiner/theorieVererbung/src/App.java @@ -0,0 +1,12 @@ +public class App { + public static void main(String[] args) throws Exception { + Fahrrad meinfahrrad = new Fahrrad("Scott", 1, 8500); + meinfahrrad.ausgabeInfoAufKonsole(); + + EBike meinEbike = new EBike("Thömus", 2, 12500, 250); + meinEbike.ausgabeInfoAufKonsole(); + + meinfahrrad.umgebungGenissen(); + meinEbike.umgebungGenissen(); + } +} \ No newline at end of file diff --git a/Code/Steiner/theorieVererbung/src/EBike.class b/Code/Steiner/theorieVererbung/src/EBike.class new file mode 100644 index 0000000..c7204ff Binary files /dev/null and b/Code/Steiner/theorieVererbung/src/EBike.class differ diff --git a/Code/Steiner/theorieVererbung/src/EBike.java b/Code/Steiner/theorieVererbung/src/EBike.java new file mode 100644 index 0000000..66168bc --- /dev/null +++ b/Code/Steiner/theorieVererbung/src/EBike.java @@ -0,0 +1,24 @@ +public class EBike extends Fahrrad { + private int leistungInWatt; + + public EBike(String marke, int artikelnummer, double preis, int leistungInWatt) { + super(marke, artikelnummer, preis); + this.leistungInWatt = leistungInWatt; + } + + public int getLeistungInWatt() { + return leistungInWatt; + } + + public void setLeistungInWatt(int leistungInWatt) { + this.leistungInWatt = leistungInWatt; + } + + // Methoden + public void ausgabeInfoAufKonsole() { + System.out.println("#" + getArtikelnummer() + " " + getMarke() + " - Preis: " + getPreis() + " - Motor: " + + leistungInWatt); + + } + +} \ No newline at end of file diff --git a/Code/Steiner/theorieVererbung/src/Fahrrad.class b/Code/Steiner/theorieVererbung/src/Fahrrad.class new file mode 100644 index 0000000..76727d1 Binary files /dev/null and b/Code/Steiner/theorieVererbung/src/Fahrrad.class differ diff --git a/Code/Steiner/theorieVererbung/src/Fahrrad.java b/Code/Steiner/theorieVererbung/src/Fahrrad.java new file mode 100644 index 0000000..ed0fb64 --- /dev/null +++ b/Code/Steiner/theorieVererbung/src/Fahrrad.java @@ -0,0 +1,43 @@ +public class Fahrrad { + private String marke; + private int artikelnummer; + private double preis; + + public Fahrrad(String marke, int artikelnummer, double preis) { + this.marke = marke; + this.artikelnummer = artikelnummer; + this.preis = preis; + } + + public String getMarke() { + return marke; + } + + public void setMarke(String marke) { + this.marke = marke; + } + + public int getArtikelnummer() { + return artikelnummer; + } + + public void setArtikelnummer(int artikelnummer) { + this.artikelnummer = artikelnummer; + } + + public double getPreis() { + return preis; + } + + public void setPreis(double preis) { + this.preis = preis; + } + + public void ausgabeInfoAufKonsole() { + System.out.println("#" + artikelnummer + " " + marke + " - Preis: " + preis); + } + + public void umgebungGenissen() { + System.out.println("Ich geniesse es, mit dem " + marke + " durch die atomar verseuchte Landschaft zu fahren"); + } +} \ No newline at end of file diff --git a/Code/Steiner/vererbungTier/.vscode/settings.json b/Code/Steiner/vererbungTier/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/vererbungTier/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/Code/Steiner/vererbungTier/README.md b/Code/Steiner/vererbungTier/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/vererbungTier/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/Code/Steiner/vererbungTier/bin/App.class b/Code/Steiner/vererbungTier/bin/App.class new file mode 100644 index 0000000..5bb9d5f Binary files /dev/null and b/Code/Steiner/vererbungTier/bin/App.class differ diff --git a/Code/Steiner/vererbungTier/bin/Hund.class b/Code/Steiner/vererbungTier/bin/Hund.class new file mode 100644 index 0000000..a7a2541 Binary files /dev/null and b/Code/Steiner/vererbungTier/bin/Hund.class differ diff --git a/Code/Steiner/vererbungTier/bin/Katze.class b/Code/Steiner/vererbungTier/bin/Katze.class new file mode 100644 index 0000000..f834755 Binary files /dev/null and b/Code/Steiner/vererbungTier/bin/Katze.class differ diff --git a/Code/Steiner/vererbungTier/bin/Tier.class b/Code/Steiner/vererbungTier/bin/Tier.class new file mode 100644 index 0000000..132df59 Binary files /dev/null and b/Code/Steiner/vererbungTier/bin/Tier.class differ diff --git a/Code/Steiner/vererbungTier/src/App.class b/Code/Steiner/vererbungTier/src/App.class new file mode 100644 index 0000000..acdc825 Binary files /dev/null and b/Code/Steiner/vererbungTier/src/App.class differ diff --git a/Code/Steiner/vererbungTier/src/App.java b/Code/Steiner/vererbungTier/src/App.java new file mode 100644 index 0000000..f6b30c9 --- /dev/null +++ b/Code/Steiner/vererbungTier/src/App.java @@ -0,0 +1,13 @@ + +public class App { + public static void main(String[] args) { + Hund bello = new Hund("Bello"); + Katze felix = new Katze("Felix"); + + bello.gibLaut(); + bello.schlafen(); + + felix.gibLaut(); + felix.schlafen(); + } +} \ No newline at end of file diff --git a/Code/Steiner/vererbungTier/src/Hund.class b/Code/Steiner/vererbungTier/src/Hund.class new file mode 100644 index 0000000..999e108 Binary files /dev/null and b/Code/Steiner/vererbungTier/src/Hund.class differ diff --git a/Code/Steiner/vererbungTier/src/Hund.java b/Code/Steiner/vererbungTier/src/Hund.java new file mode 100644 index 0000000..bee53b0 --- /dev/null +++ b/Code/Steiner/vererbungTier/src/Hund.java @@ -0,0 +1,12 @@ + +// Subklasse Hund +public class Hund extends Tier { + public Hund(String name) { + super(name); + } + + @Override + public void gibLaut() { + System.out.println(name + " macht Wau"); + } +} \ No newline at end of file diff --git a/Code/Steiner/vererbungTier/src/Katze.class b/Code/Steiner/vererbungTier/src/Katze.class new file mode 100644 index 0000000..0194f95 Binary files /dev/null and b/Code/Steiner/vererbungTier/src/Katze.class differ diff --git a/Code/Steiner/vererbungTier/src/Katze.java b/Code/Steiner/vererbungTier/src/Katze.java new file mode 100644 index 0000000..b7cf85b --- /dev/null +++ b/Code/Steiner/vererbungTier/src/Katze.java @@ -0,0 +1,11 @@ +// Subklasse Katze +public class Katze extends Tier { + public Katze(String name) { + super(name); + } + + @Override + public void gibLaut() { + System.out.println(name + " macht miau"); + } +} \ No newline at end of file diff --git a/Code/Steiner/vererbungTier/src/Tier.class b/Code/Steiner/vererbungTier/src/Tier.class new file mode 100644 index 0000000..6872ab2 Binary files /dev/null and b/Code/Steiner/vererbungTier/src/Tier.class differ diff --git a/Code/Steiner/vererbungTier/src/Tier.java b/Code/Steiner/vererbungTier/src/Tier.java new file mode 100644 index 0000000..cddbfdd --- /dev/null +++ b/Code/Steiner/vererbungTier/src/Tier.java @@ -0,0 +1,14 @@ +// Superklasse Tier +public abstract class Tier { + protected String name; + + public Tier(String name) { + this.name = name; + } + + public abstract void gibLaut(); + + public void schlafen() { + System.out.println(name + " schläft"); + } +}