1. W klasie Solution utwórz 4 konstruktory z różnymi modyfikatorami dostępu.
2. W osobnym pliku utwórz klasę SubSolution będącą obiektem podrzędnym klasy Solution.
3. W klasie SubSolution użyj komendy Alt+Insert -> Constructors, aby utworzyć konstruktory.
4. Popraw modyfikatory dostępu konstrukto
Przeciążanie konstruktorów
- 8
Niedostępne
Komentarze (1)
- Popularne
- Najnowsze
- Najstarsze
Musisz się zalogować, aby dodać komentarz
Misiu
21 kwietnia 2020, 22:41
I have constructors without bodies. And no variables in classes Solution and SubSolution.
In class SubSolution I used super() method in constructors.
e.g.
In S:
protected Solution (double x) {
}
In SS:
protected SubSolution(double x) {
super(x);
}
0