| Forums.Sureshkumar.net : A Perfect Place to Share Knowledge Blogs Games Magazines |
|
|
#1 (permalink) |
|
Member
Join Date: Feb 2006
Location: India
Posts: 48
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4
|
1)Can anyone tell me the main difference between overridding and inheritance? 2)At very first time how the server identifies the browser request and how it gives the response to the particular browser before the session is assigned? Please try to answer this questions urgent. Thanks & Rgds |
|
|
|
|
|
#2 (permalink) |
|
Senior Member
Join Date: Feb 2006
Location: India
Posts: 546
Thanks: 7 Thanked 7 Times in 5 Posts Thanks: 7
Thanked 7 Times in 5 Posts
Rep Power: 8
|
. inheritance: inheritance is a property by which u canuse the datas and values of another class in ur class. mainly inheritance can be used when ur more specific abtclass's functionality. if u've created a class for salary calc of an employee and after that u r in need of calculating overtime for that emp that time instead of rewriting a class combiningsalcalc and ot calc u can simply extend salary class in ot class. overriding : overriding is mainly used to support run time polymorphism. in class hierarchy when amethod in sub class has same name and type as super class then sub class method is said to overrride super class method. run time polymorphism /dynamic method dispatch-is a mechanism by which a call to a overrriden method is resolved at runtime . An instance method in a subclass with the same signature and return type as an instance method in the superclass overrides the superclass's method. (Remember that a method's signature is its name and the number and the type of its arguments.) You can also override a method with the same signature that returns a subclass of the object returned by the original method. public class Animal { The second class, a subclass of Animal, is called Cat: public class Cat extends Animal { The Cat class overrides the instance method in Animal called override and hides the class method in Animal called hide. The main method in this class creates an instance of Cat and calls the hide on the class and override on the instance. It is considered bad style to call static methods on instances because hiding can be confusing. So it is better to use the class, for example Animal.hide or Cat.hide. The output from this program is as follows: The hide method in Animal.
__________________
try try try till u succeed meenakshi
|
|
|
|
|
|
#3 (permalink) |
|
Moderator
Join Date: Feb 2006
Posts: 1,413
Thanks: 0 Thanked 9 Times in 8 Posts Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18
|
hello
1)Can anyone tell me the main difference between overridding and inheritance? . Method overriding : When a method in a class having the same method name with same arguments is said to be method overriding. There is relationship between a superclass method and subclass method.Overloading does not block inheritance from the superclass whereas overriding blocks inheritance from the superclass.In overriding, subclass method replaces the superclass. overriding must have same signature. Inheritance is the process of inheriting all the features from a class. The advantages of inheritance are reusability of code and accessibility of variables and methods of the super class by subclasses Inheritance is the process by which one object acquires the properties of another object. follow the examples of what meena has said ... bye sowmya
__________________
http://livetolead.blogspot.com/ all the best Arise Awake N Stop Not Until Ur Goal Is Reached! |
|
|
|
|
|
#4 (permalink) |
|
Moderator
Join Date: Feb 2006
Posts: 1,413
Thanks: 0 Thanked 9 Times in 8 Posts Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18
|
hello
At very first time how the server identifies the browser request and how it gives the response to the particular browser before the session is assigned? well the answer is when ever we type an URL for an application the entire processing will be like this 1 Request for the webpage thru browser 2 Request is sent to the server ( Every application will have server (mostly) since dynamic HTML pages) This server will have a IP ADREESS OR PORT what ever .. 3 Here the request is being processed (known as application server- where business logic is be processed) 4 The application server as soon as the request is processed it will fetch the data thru the data base (if necessary ) 5 from the data base info for the request will be coming back to the application server or web server( jus handles request n reponse no business logic processing will be done ) 6 the web server will send the response(WHAT EVER THE USER HAS REQUESTED ) back to the BROWSER WELL EVERY SERVER(APPLICATION SERVER /WEB SERVER WILL BE ASSOCIATED WITH PARTICULAR ADD RESS (which is unique ) ... so that how entire communication will be done hope i cleared ur doubt if not please ask me regards sowmya
__________________
http://livetolead.blogspot.com/ all the best Arise Awake N Stop Not Until Ur Goal Is Reached! |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|