Course Solutions Uncategorized (Solved) : Find Error Code Explain Reason Also Write Correct Code 075 Public Class X Private Int N Pu Q31607300 . . . .

(Solved) : Find Error Code Explain Reason Also Write Correct Code 075 Public Class X Private Int N Pu Q31607300 . . . .

 

Can you find out the error in the below code? Explainthe reason and also write correct code. [0.75]

public class X {

     privateint n;

     publicX(int i)

     {

          n=i;

     }

     publicvoid show()

    {System.out.println(n);

     }

}

          

public class Yextends X{

     public Y()

     {

     }

     publicvoid show()

{

super.show();

}

}

public class Test {

     publicstatic void main(String[] args){

          Yob=new Y();

         ob.show();

     }

}

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

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

Related Post

(Solved) : Book Determine Whether Statements True False Provide Justification 2 12 2 Set T S0 0 H Car Q34696747 . . . .(Solved) : Book Determine Whether Statements True False Provide Justification 2 12 2 Set T S0 0 H Car Q34696747 . . . .

<p><br/><img alt="Not in Book. Determine whether each of these statements is true or false and provide a justification for each: * 2) 12, (2))" src="https://media.cheggcdn.com/media%2Ff2c%2Ff2c96946-7bf4-489c-8203-5c59fc708104%2FphpUPvFlF.png" style="height:256px;width:786px;" aria-describedby="d3f"/></p>Not in Book. Determine