Не понимаю, вроде создал текст, объект внизу для каждого цвета, компилируют, но пишет что не создано 7 объектов.
package com.javarush.task.task03.task0315;
/*
Каждый охотник желает знать…
*/
public class Solution {
public static void main(String[] args) {
System.out.println("Red");
System.out.println("Orange");
System.out.println("Yellow");
System.out.println("Green");
System.out.println("Blue");
System.out.println("Indigo");
System.out.println("Violet");
}
public static class Red {
public Red() {
System.out.println("Red");
}
}
public static class Orange {
public Orange() {
System.out.println("Orange");
}
}
public static class Yellow {
public Yellow() {
System.out.println("Yellow");
}
}
public static class Green {
public Green() {
System.out.println("Green");
}
}
public static class Blue {
public Blue() {
System.out.println("Blue");
}
}
public static class Indigo {
public Indigo() {
System.out.println("Indigo");
}
}
public static class Violet {
public Violet() {
System.out.println("Violet");
}
}
}