13
Uppgift
Java Multithreading, nivå, lektion
Refactoring Rectangle
In the Rectangle class:
1. Change the getHeight and getWidth methods so that they return HasHeight and HasWidth objects, respectively.
2. To do this, inside the getHeight and getWidth methods, create local classes that implement the interfaces.
26
Uppgift
Java Multithreading, nivå, lektion
Black box
1. Repair the logic of the someAction method for the solutionAction field.
2. See the comment on the main method for example output.
3. Hint: if param > 0, then the someAction method of an anonymous class in the solutionAction field should call a method of the FirstClass subclass.
7
Uppgift
Java Multithreading, nivå, lektion
Inheriting an inner class
Inside the Solution class, create 2 public inner classes: ThreeBedroomApt and BigHall.
Make them inherit Apartment and Hall.