what is the output?? class practice { static short type ; public SuperTest( int a) { type = ( short )a; } public static void manip( int delta) { type += delta; } } public class JavaTest extends...



what is the  output??



class
practice


{


staticshorttype;


public SuperTest(int a)


     {


type = (short)a;


     }


publicstaticvoid manip(int delta)


     {


type += delta;


     }


}



publicclass JavaTestextends SuperTest


{


int item;


private JavaTest(int a)


     {


super(a);


           item = a;


     }


publicstaticvoid manip(int delta)


     {


type -= delta;


     }


publicint getTotal()


     {


return item+type;


     }


publicstaticvoid main(String[] args)


     {


           SuperTest bob =new JavaTest(10);


           bob.manip(5);


int num = ((JavaTest)bob).getTotal();


           JavaTest tim =new JavaTest(num);


           tim.manip(12);


           System.
out
.println(tim.getTotal());


     }



}



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here