• Post Reply Bookmark Topic Watch Topic
  • New Topic

java inheritance function  RSS feed

 
gong pex
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

now I began to learn JSP,

when I read JSP book, many tags java, inside servlets and JSP, often use "extend" or in short "inheritance".

can you explain to me what function in real (for what's application)

please tell me.

Thanks
 
vinayak jog
Ranch Hand
Posts: 83
MySQL Database Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ask questions clearly
1. you want to know about functions ?
or
2. you want to know about the inheritance ?

Ans1. Function is a set of instructions grouped to perform a particular task. Examples to functions can be add subtract divide etc., (mathematical functions). In java we call functions as methods because functions have individual existence where as methods are written in a class.


Ans2 . I ll explain assuming that you are asking about the inheritance.
Assume one animal which has four legs, a abdomen, head, thorax etc., This animal can be a dog or can be a cat also. This we call as mother class.
If we want to write a dog class we need just inherit the animal class that we already have specified and then add some specialty to dog class ex. barking because dogs often bark.

If we want to write the a cat class we just need to inherit the animal and add special features of cat like afraid of water.



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Modern JDP should have no Java code in it. None.

Find an updated book that emphasizes proper use of the JSTL and EL in JSP pages as opposed to discredited scriptlets.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!