Advertisement
jaVer404

level15.lesson12.home05

Jul 18th, 2015
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.41 KB | None | 0 0
  1. package com.javarush.test.level15.lesson12.home05;
  2.  
  3. /* Перегрузка конструкторов
  4. 1. В классе Solution создайте по 3 конструктора для каждого модификатора доступа.
  5. 2. В отдельном файле унаследуйте класс SubSolution от класса Solution.
  6. 3. Внутри класса SubSolution создайте конструкторы командой Alt+Insert -> Constructors.
  7. 4. Исправьте модификаторы доступа конструкторов в SubSolution так, чтобы они соответствовали конструкторам класса Solution.
  8. */
  9.  
  10. public class Solution {
  11.  
  12.     public Solution () {}
  13.     public Solution (String s1, String s2) {}
  14.     public Solution (String s1, String s2, String s3) {}
  15.  
  16.     protected Solution (int i1) {}
  17.     protected Solution (int i1, int i2) {}
  18.     protected Solution (int i1, int i2, int i3) {}
  19.  
  20.     Solution (boolean b1) {}
  21.     Solution (boolean b1, boolean b2) {}
  22.     Solution (boolean b1, boolean b2, boolean b3) {}
  23.  
  24.     private Solution (short o1) {}
  25.     private Solution (short o1, short o2) {}
  26.     private Solution (short o1, short o2, short o3) {}
  27. }
  28. /*--------------------------------------------------------------------------*/
  29. package com.javarush.test.level15.lesson12.home05;
  30.  
  31. /**
  32.  * Created by Roma on 18.07.2015.
  33.  */
  34. public class SubSolution extends Solution
  35. {
  36.     public SubSolution()
  37.     {
  38.         super();
  39.     }
  40.  
  41.     public SubSolution(String s1, String s2)
  42.     {
  43.         super(s1, s2);
  44.     }
  45.  
  46.     public SubSolution(String s1, String s2, String s3)
  47.     {
  48.         super(s1, s2, s3);
  49.     }
  50.  
  51.     protected SubSolution(int i1)
  52.     {
  53.         super(i1);
  54.     }
  55.  
  56.     protected SubSolution(int i1, int i2)
  57.     {
  58.         super(i1, i2);
  59.     }
  60.  
  61.     protected SubSolution(int i1, int i2, int i3)
  62.     {
  63.         super(i1, i2, i3);
  64.     }
  65.  
  66.     SubSolution(boolean b1)
  67.     {
  68.         super(b1);
  69.     }
  70.  
  71.     SubSolution(boolean b1, boolean b2)
  72.     {
  73.         super(b1, b2);
  74.     }
  75.  
  76.     SubSolution(boolean b1, boolean b2, boolean b3)
  77.     {
  78.         super(b1, b2, b3);
  79.     }
  80.  
  81.     private SubSolution (short o1) {
  82.         super();
  83.     }
  84.     private SubSolution (Object o1, Object o2) {
  85.         super();
  86.     }
  87.     private SubSolution (Object o1, Object o2, Object o3) {
  88.         super();
  89.     }
  90.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement