Computer Science, asked by shreeyab, 1 year ago

which keyword is used for inheritance in Java? ​


shreeyab: Welcome @chitrita
shreeyab: you really answered correctly

Answers

Answered by ankitasaloafer
0

keyword which is used for inheritance in java is .......... this keyword.


shreeyab: ase koi risk leta had?
shreeyab: isko risk nhin exposure Ya phir galti kaha jata hai
shreeyab: it's OK.. as per your wish.
shreeyab: whatever you do
ayushmaandey13: Wow tum kitna Fi kar karti ho mera
ayushmaandey13: Thanks yaar
shreeyab: srsly?
shreeyab: k.. whatever you consider
shreeyab: yeah.. u r right chitrita
Answered by franktheruler
1

Answer:

Extend keyword is used for inheritance in java. when we inherit a class from base class then we use extend keyword.  Suppose class A is a base class and class B is inherited from class A. Then we use extend keyword for implementing inheritance.    

Example of extend keyword:

class A

{

protected int x, y;

void input( int a , int  b)

{

x=a;

y=b;

}

int add ( )

{

return (x+y);

}

}

class B extends A

{

int mul ( )

{

return (x*y);

}

}

class Main_class

{

public static void main( string args[] )

{    ..........

    ..........

   .........

         

  }

} // end of main class

Similar questions