Course Solutions Uncategorized (Solved) : Following Code Written Correctly Justify Answer 025 Class Class Interface B Extends Interf Q31474201 . . . .

(Solved) : Following Code Written Correctly Justify Answer 025 Class Class Interface B Extends Interf Q31474201 . . . .

 

Is the following code written correctly? Justify youranswer. [0.25]

class A

{

    //Class A

}

interface B extends A

{

    //Interface Bextending Class A

}

What will be the output of the following program?[0.75]

interface P

{

    String p =”PPPP”;

     

    StringmethodP();

}

interface Q extends P

{

    String q =”QQQQ”;

     

    StringmethodQ();

}

class R implements P, Q

{

    public StringmethodP()

    {

        return q+p;

    }

     

    public StringmethodQ()

    {

        return p+q;

    }

}

public class MainClass

{

    public staticvoid main(String[] args)

    {

        R r = new R();

         

        System.out.println(r.methodP());

         

        System.out.println(r.methodQ());

    }

}

Expert Answer


An

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post