Menu
Question Index
...

What set of lines when placed at PLACE LINES HERE will allow the program to compile successfully? Note that the order of lines is also important. Choose the option where all sets are valid.

public class MixingExceptionsTest {
    //LINE A = catch (CanNotMixException e) {}
    //LINE B = catch (CanNotGrindException e) {}
    //LINE C = catch (CanNotPulseException e) {}
    //LINE D = catch (Exception e) {}
    //LINE E = catch (Throwable e) {}
    public static void main(String[] args) {
        try {
            Mixer m = new Mixer();
            m.mix();
            m.grind();
            m.pulse();
        }
        /* PLACE LINES HERE */
    }
}
class CanNotMixException extends Exception {}
class CanNotGrindException extends Throwable {}
class CanNotPulseException extends RuntimeException {}

class Mixer {
    void mix() throws CanNotGrindException {}
    void grind() throws CanNotMixException {}
    void pulse() throws CanNotPulseException {}
}


DE,E,BD,DB,A,B
DE,E,BD,ABC,BAC,CBA,AB,BA,
DE,ED,E,BD,DB,ABC,
DE,BD,DB,AB,BA,EA,

Doubts

Problems

Topic: Java Throw Keyword - Java Throws Keyword

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App