package com.codegym.task.task03.task0315; /* Roy G. Biv… */ public class Solution { public static void main(String[] args) { Red obj1=new Red(); obj1.red(); Orange obj2=new Orange(); obj2.orange(); Yellow obj3=new Yellow(); obj3.yellow(); Green obj4=new Green(); obj4.green(); Blue obj5=new Blue(); obj5.blue(); Indigo obj6=new Indigo(); obj6.indigo(); Violet obj7=new Violet(); obj7.violet(); } public static class Red { public void red() { System.out.println("Red"); } } public static class Orange { public void orange() { System.out.println("Orange"); } } public static class Yellow { public void yellow() { System.out.println("Yellow"); } } public static class Green { public void green() { System.out.println("Green"); } } public static class Blue { public void blue() { System.out.println("Blue"); } } public static class Indigo { public void indigo() { System.out.println("Indigo"); } } public static class Violet { public void violet() { System.out.println("Violet"); } } }