why sir you created pls explain that one......
Red red = new Red();
red.Red();
public class Solution {
public static void main(String[] args) {
//write your code here
Red red = 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");
}
}
}