Created
August 24, 2017 01:25
-
-
Save P0huber/91ffa8bc8d25c2b76d71d5488bb4350f to your computer and use it in GitHub Desktop.
Fields of class and constructors. Поля класса и конструкторы. [Java]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FieldsAndConstructors { | |
public static void main(String[] args) {} | |
public static class Human { | |
private String s = ""; | |
private int i = 1, i3 = 1, i4 = 1, i5 = 1; | |
private char ch = '0'; | |
public Human() {} | |
public Human(String s) {} | |
public Human(String s, int i) {} | |
public Human(int i, int ii) {} | |
public Human(String s, int i, char y) {} | |
public Human(String s, int i, int r) {} | |
public Human(String s, int i, char y, int r) {} | |
public Human(int i, int r, int m) {} | |
public Human(String s, int i, int ii, int d) {} | |
public Human(int i, int r, char y) {} | |
}} | |
/*Конструкторы класса Human | |
Напиши класс Human с 6 полями. | |
Придумай и реализуй 10 различных конструкторов для него. | |
Каждый конструктор должен иметь смысл. | |
Требования: | |
1. Программа не должна считывать данные с клавиатуры. | |
2. В классе Human должно быть 6 полей. | |
3. Все поля класса Human должны быть private. | |
4. В классе Human должно быть 10 конструкторов. | |
5. Все конструкторы класса Human должны быть public.*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment