Доброй ночи.
Реально ли решение данной задачи через возврат каретки?
Если да, то наведите на мысли?
Если нет, то наведите на мысли, что я должен найти?)))
Спасибо.
package com.javarush.task.task03.task0315;
/*
Каждый охотник желает знать…
*/
public class Solution {
public static void main(String[] args) {
//напишите тут ваш код
char ch = '\r';
Red r = new Red();
System.out.print(ch);
Orange o = new Orange();
System.out.print(ch);
Yellow y = new Yellow();
System.out.print(ch);
Green g = new Green();
System.out.print(ch);
Blue b = new Blue();
System.out.print(ch);
Indigo i = new Indigo();
System.out.print(ch);
Violet v = new Violet();
System.out.print(ch);
}
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");
}
}
}