Course Solutions Uncategorized (Solved) : Output Following Program 075 Interface P String P Pppp String Methodp Interface Q Extends Q31607264 . . . .

(Solved) : Output Following Program 075 Interface P String P Pppp String Methodp Interface Q Extends Q31607264 . . . .

 

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());

    }

}

Learning Outcome(s):

LO 1 : Understand and be able to design and implement programsusing object oriented programming concepts like: encapsulation,inheritance, polymorphism, abstract classes and methods

Expert Answer


An answer

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