Suppose the class Sub extends class Sandwich. Which of the f…

Suppose the class Sub extends class Sandwich. Which of the following assignments are legal?  Sandwich x = new Sandwich();Sub y = new Sub();a.) x = y;b.) y = x;c.) y = new Sandwich();d.) x = new Sub(); You can assume a-d above execute in order. Select only the assignments that are valid. Note the checkboxes may be shuffled by canvas (so when considering each, assume it’s in the order shown in the code above — each one is labeled a-d for this reason)

Given the following method:     public static int findChar(c…

Given the following method:     public static int findChar(char letterToFind, String source) {            if ((source == null) || (source.isEmpty())) {        throw new IllegalArgumentException(“must provide a string”);    }    char[] chars = source.toCharArray();        for (int i =0; i< chars.length; i++){        char c = chars[i];        if (c == letterToFind){            return i;        }                }    return -1;}   If called as follows:int result = findChar('w',"The bird sang woe is me"); What is the result?