I tried but was unable to get walkthrough of this question. Kinldy explain me in detail
package com.codegym.task.task03.task0315;
/*
Roy G. Biv…
*/
public class Solution {
public static void main(String[] args) {
//write your code here
Red r = new Red();
red.Red();
Orange orange = new Orange();
orange.Orange();
Yellow yellow = new Yellow();
yellow.Yellow();
Green green = new Green();
green.Green();
Blue blue = new Blue();
blue.Blue();
Indigo indigo = new Indigo();
indigo.Indigo();
Violet violet = new Violet();
violet.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");
}
}
}