Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.javarush.test.level15.lesson12.home05;
- /* Перегрузка конструкторов
- 1. В классе Solution создайте по 3 конструктора для каждого модификатора доступа.
- 2. В отдельном файле унаследуйте класс SubSolution от класса Solution.
- 3. Внутри класса SubSolution создайте конструкторы командой Alt+Insert -> Constructors.
- 4. Исправьте модификаторы доступа конструкторов в SubSolution так, чтобы они соответствовали конструкторам класса Solution.
- */
- public class Solution {
- public Solution () {}
- public Solution (String s1, String s2) {}
- public Solution (String s1, String s2, String s3) {}
- protected Solution (int i1) {}
- protected Solution (int i1, int i2) {}
- protected Solution (int i1, int i2, int i3) {}
- Solution (boolean b1) {}
- Solution (boolean b1, boolean b2) {}
- Solution (boolean b1, boolean b2, boolean b3) {}
- private Solution (short o1) {}
- private Solution (short o1, short o2) {}
- private Solution (short o1, short o2, short o3) {}
- }
- /*--------------------------------------------------------------------------*/
- package com.javarush.test.level15.lesson12.home05;
- /**
- * Created by Roma on 18.07.2015.
- */
- public class SubSolution extends Solution
- {
- public SubSolution()
- {
- super();
- }
- public SubSolution(String s1, String s2)
- {
- super(s1, s2);
- }
- public SubSolution(String s1, String s2, String s3)
- {
- super(s1, s2, s3);
- }
- protected SubSolution(int i1)
- {
- super(i1);
- }
- protected SubSolution(int i1, int i2)
- {
- super(i1, i2);
- }
- protected SubSolution(int i1, int i2, int i3)
- {
- super(i1, i2, i3);
- }
- SubSolution(boolean b1)
- {
- super(b1);
- }
- SubSolution(boolean b1, boolean b2)
- {
- super(b1, b2);
- }
- SubSolution(boolean b1, boolean b2, boolean b3)
- {
- super(b1, b2, b3);
- }
- private SubSolution (short o1) {
- super();
- }
- private SubSolution (Object o1, Object o2) {
- super();
- }
- private SubSolution (Object o1, Object o2, Object o3) {
- super();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement