diff --git a/docs/additional-material/daniel-java1/sample-exam.md b/docs/additional-material/daniel-java1/sample-exam.md index 3b365ef785..945fbe2df7 100644 --- a/docs/additional-material/daniel-java1/sample-exam.md +++ b/docs/additional-material/daniel-java1/sample-exam.md @@ -120,10 +120,10 @@ classDiagram Class o-- CourseOfStudies class Class { - -description: String - -courseOfStudies: CourseOfStudies - -lectures: List~Lecture~ - -students: List~Student~ + -description: String {final} + -courseOfStudies: CourseOfStudies {final} + -lectures: List~Lecture~ {final} + -students: List~Student~ {final} +Class(description: String, courseOfStudies: CourseOfStudies) +description() String +courseOfStudies() CourseOfStudies @@ -136,8 +136,8 @@ classDiagram } class Student { - -matriculationNumber: String - -name: String + -matriculationNumber: String {final} + -name: String {final} +Student(matriculationNumber: String, name: String) +matriculationNumber() String +name() String @@ -145,8 +145,8 @@ classDiagram } class Lecture { - -description: String - -creditPoints: int + -description: String {final} + -creditPoints: int {final} +Lecture(description: String, creditPoints: int) +description() String +creditPoints() int @@ -158,7 +158,7 @@ classDiagram WI = Wirtschaftsinformatik INF = Informatik BWL = Betriebswirtschaftslehre - -description: String + -description: String {final} } class ExamTask02 { @@ -185,10 +185,10 @@ classDiagram ```java title="Class.java" showLineNumbers public class Class { // 0,5 - private String description; // 0,25 - private CourseOfStudies courseOfStudies; // 0,25 - private List lectures; // 0,25 - private List students; // 0,25 + private final String description; // 0,25 + private final CourseOfStudies courseOfStudies; // 0,25 + private final List lectures; // 0,25 + private final List students; // 0,25 public Class(String description, CourseOfStudies courseOfStudies) { // 0,5 this.description = description; // 0,25 @@ -381,9 +381,9 @@ classDiagram } class Player { - -name: String + -name: String {final} -healthPoints: int - -dice: Dice + -dice: Dice {final} +Player(name: String) +name() String +getHealthPoints() int @@ -433,9 +433,9 @@ Hans gewinnt ```java title="Player.java" showLineNumbers public class Player { // 0,5 - private String name; // 0,25 + private final String name; // 0,25 private int healthPoints; // 0,25 - private Dice dice; // 0,25 + private final Dice dice; // 0,25 public Player(String name) { // 0,5 this.name = name; // 0,25 @@ -528,34 +528,34 @@ classDiagram Recipe o-- Ingredient class CookieJar { - -cookies: List~Cookie~ + -cookies: List~Cookie~ {final} +CookieJar() +addCookie(cookie: Cookie) void +getStuffedCookie() StuffedCookie } class Cookie { - -name: String - -dough: Recipe + -name: String {final} + -dough: Recipe {final} +Cookie(name: String, dough: Recipe) +getIngredients() List~Ingredient~ } class StuffedCookie { - -jam: Recipe + -jam: Recipe {final} +StuffedCookie(name: String, dough: Recipe, jam: Recipe) +getIngredients() List~Ingredient~ } class Recipe { - -name: String - -ingredients: List~Ingredient~ + -name: String {final} + -ingredients: List~Ingredient~ {final} +Recipe(name: String) +addIngredient(ingredient: Ingredient) void } class Ingredient { - -name: String + -name: String {final} +Ingredient(name: String) } @@ -597,7 +597,7 @@ Zucker ```java title="StuffedCookie.java" showLineNumbers public class StuffedCookie extends Cookie { // 1 - private Recipe jam; // 0,25 + private final Recipe jam; // 0,25 public StuffedCookie(String name, Recipe dough, Recipe jam) { // 0,5 super(name, dough); // 1 @@ -622,7 +622,7 @@ public class StuffedCookie extends Cookie { // 1 ```java title="CookieJar.java" showLineNumbers public class CookieJar { // 0,5 - private List cookies; // 0,25 + private final List cookies; // 0,25 public CookieJar() { // 0,5 cookies = new ArrayList<>(); // 0,25 diff --git a/docs/additional-material/daniel-java2/sample-exam.md b/docs/additional-material/daniel-java2/sample-exam.md index 6326bf73fb..aa0d30eecb 100644 --- a/docs/additional-material/daniel-java2/sample-exam.md +++ b/docs/additional-material/daniel-java2/sample-exam.md @@ -40,9 +40,9 @@ classDiagram class SuperHuman { <> - -name: String - -universe: Universe - -power: int + -name: String {final} + -universe: Universe {final} + -power: int {final} +SuperHuman(name: String, universe: Universe, power: int) +name() String +universe() Universe @@ -65,9 +65,9 @@ classDiagram class SuperLeague~T extends SuperHuman~ { <> - -name: String - -universe: Universe - -members: Map~T, Boolean~ + name: String + universe: Universe + members: Map~T, Boolean~ +addSuperHuman(t: T) void +getMostPowerfulSuperHuman() Optional~T~ +getAllAvailableSuperHumans() List~T~ @@ -169,9 +169,9 @@ classDiagram class SuperHuman { <> - -name: String - -universe: Universe - -power: int + -name: String {final} + -universe: Universe {final} + -power: int {final} +SuperHuman(name: String, universe: Universe, power: int) +name() String +universe() Universe @@ -194,9 +194,9 @@ classDiagram class SuperLeague~T extends SuperHuman~ { <> - -name: String - -universe: Universe - -members: Map~T, Boolean~ + name: String + universe: Universe + members: Map~T, Boolean~ +addSuperHuman(t: T) void +getMostPowerfulSuperHuman() Optional~T~ +getAllAvailableSuperHumans() List~T~ @@ -277,18 +277,18 @@ classDiagram class Single { <> - -name: String - -artist: Artist - -salesInMillions: int - -publishingYear: String + name: String + artist: Artist + salesInMillions: int + publishingYear: String } class Artist { <> - -name: String - -country: Country - -birthdate: LocalDate - -isAlive: boolean + name: String + country: Country + birthdate: LocalDate + isAlive: boolean } class Country { @@ -304,7 +304,7 @@ classDiagram class SingleQueries { <> - -singles: List~Single~ + singles: List~Single~ +printAllSinglesWithMoreThan25MillionSalesPerCountry() void +printAverageBirthYearOfAllDeceasedArtists() void +isAnySingleFromChinaWithMoreThan10MillionSales() boolean