AHHHHHHHHHH COMMITED TO GITHUB INSTEAD OF FORGEJO FOR WEEKS
This commit is contained in:
parent
d6ef44f3d1
commit
0919005cb2
163 changed files with 3875 additions and 47 deletions
7
Code/Steiner/samsung(Interfaces-task)/.vscode/settings.json
vendored
Normal file
7
Code/Steiner/samsung(Interfaces-task)/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"java.project.sourcePaths": ["src"],
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
}
|
18
Code/Steiner/samsung(Interfaces-task)/README.md
Normal file
18
Code/Steiner/samsung(Interfaces-task)/README.md
Normal file
|
@ -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).
|
BIN
Code/Steiner/samsung(Interfaces-task)/bin/App.class
Normal file
BIN
Code/Steiner/samsung(Interfaces-task)/bin/App.class
Normal file
Binary file not shown.
BIN
Code/Steiner/samsung(Interfaces-task)/bin/GalaxyJ3.class
Normal file
BIN
Code/Steiner/samsung(Interfaces-task)/bin/GalaxyJ3.class
Normal file
Binary file not shown.
BIN
Code/Steiner/samsung(Interfaces-task)/bin/GalaxyS5.class
Normal file
BIN
Code/Steiner/samsung(Interfaces-task)/bin/GalaxyS5.class
Normal file
Binary file not shown.
BIN
Code/Steiner/samsung(Interfaces-task)/bin/ITelefon.class
Normal file
BIN
Code/Steiner/samsung(Interfaces-task)/bin/ITelefon.class
Normal file
Binary file not shown.
BIN
Code/Steiner/samsung(Interfaces-task)/bin/Samsung.class
Normal file
BIN
Code/Steiner/samsung(Interfaces-task)/bin/Samsung.class
Normal file
Binary file not shown.
24
Code/Steiner/samsung(Interfaces-task)/src/App.java
Normal file
24
Code/Steiner/samsung(Interfaces-task)/src/App.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
import java.util.ArrayList;
|
||||
|
||||
public class App {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ArrayList<Samsung> devices = new ArrayList<Samsung>();
|
||||
devices.add(new GalaxyJ3(11.85, "Phone"));
|
||||
devices.add(new GalaxyS5(12.45, "phone", "sunset-black"));
|
||||
|
||||
for (Samsung samsung : devices) {
|
||||
System.out.println(samsung.preis);
|
||||
System.out.println(samsung.produktTyp);
|
||||
if (samsung instanceof GalaxyS5) {
|
||||
System.out.println(((GalaxyS5) samsung).farbe);
|
||||
}
|
||||
System.out.println("Funktionstest");
|
||||
if (samsung instanceof ITelefon) {
|
||||
((ITelefon) samsung).powerOn();
|
||||
((ITelefon) samsung).esKlingelt();
|
||||
((ITelefon) samsung).anrufen();
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
22
Code/Steiner/samsung(Interfaces-task)/src/GalaxyJ3.java
Normal file
22
Code/Steiner/samsung(Interfaces-task)/src/GalaxyJ3.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
public class GalaxyJ3 extends Samsung implements ITelefon {
|
||||
|
||||
public GalaxyJ3(double preis, String produktTyp) {
|
||||
super(preis, produktTyp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void powerOn() {
|
||||
System.out.println("GalaxyJ3 is starting");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void esKlingelt() {
|
||||
System.out.println("DING DING DING");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void anrufen() {
|
||||
System.out.println("No one will pick up - since you have no signal in the basement");
|
||||
}
|
||||
|
||||
}
|
23
Code/Steiner/samsung(Interfaces-task)/src/GalaxyS5.java
Normal file
23
Code/Steiner/samsung(Interfaces-task)/src/GalaxyS5.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
public class GalaxyS5 extends Samsung implements ITelefon {
|
||||
String farbe;
|
||||
|
||||
public GalaxyS5(double preis, String produktTyp, String farbe) {
|
||||
super(preis, produktTyp);
|
||||
this.farbe = farbe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void powerOn() {
|
||||
System.out.println("GalaxyJ5 is starting");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void esKlingelt() {
|
||||
System.out.println("DING DING DING");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void anrufen() {
|
||||
System.out.println("No one will pick up - since you have no signal in the basement");
|
||||
}
|
||||
}
|
7
Code/Steiner/samsung(Interfaces-task)/src/ITelefon.java
Normal file
7
Code/Steiner/samsung(Interfaces-task)/src/ITelefon.java
Normal file
|
@ -0,0 +1,7 @@
|
|||
public interface ITelefon {
|
||||
public void powerOn();
|
||||
|
||||
public void esKlingelt();
|
||||
|
||||
public void anrufen();
|
||||
}
|
9
Code/Steiner/samsung(Interfaces-task)/src/Samsung.java
Normal file
9
Code/Steiner/samsung(Interfaces-task)/src/Samsung.java
Normal file
|
@ -0,0 +1,9 @@
|
|||
public abstract class Samsung {
|
||||
double preis;
|
||||
String produktTyp;
|
||||
|
||||
public Samsung(double preis, String produktTyp) {
|
||||
this.preis = preis;
|
||||
this.produktTyp = produktTyp;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue