I have two classes Instrument (contains instrument names) and Musician (contains Instrument, musical name and position) The validation that I have to relate is: If the name of the musician does not correspond to his instrument and his position print error. Apart I must validate that they are all members.
To compare only two Strings in another exercise I used the following: String string1 = new String ("Hello"); String string2 = new String ("Hello"); if (string1.equals (string2)) { ... }
up there all right, but I do not know how to put the third strings. I thought about using an else but I do not know how to save the first comparison as a single string.