What is Abstract Methods and Class ?

No comments

By  making  a   method  final  we  ensure  that  the  method  is  not  redefine  in  subclass.  That  is  the  method  can  be  subclass.  Java  allows  us  to  do  something  that   is  exactly  opposite  to  this.  That  is  we  can  indicate  that  a  method  must  always  be  redefined  in  a  subclass  thus  making  overriding  subclass.  This  is  done  the  modifier  keywords  abstract  in  the  methods  definition  such  as :

abstract  class  add

{—————————-

abstract  void  draw();

—————————-

—————————–

}

When  a  class  contain  one  or  more  abstract  methods  it  should  also  be  declare  as  abstract.

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀