Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
finding java difficult
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="wilberX, post: 653618"] Overriding methods can be confusing at first, but it provides a useful solution to object oriented problems. One useful feature of object oriented programming is being able to re-use the same code to get different results. Lets say you have a superclass and two subclasses that both inherit from this superclass. And lets say that you want to use a method in the superclass to get different results for each subclass. In procedural programming, you would need to write a different method for each result you want. The helpful thing about object oriented is you can "overide" this method in each subclass. All this overiding means is that you will write your method in your superclass, and then overide it by using the same method in a subclass. This overidden method in each sublass can be tailored to do different things than the original method that your are overiding from the superclass. Its that easy! It might seem abnormal, but go ahead and try it. Remember, the compiling errors are usually specific and will tell you what and where you went wrong. Also try looking up info about abstract methods and classes. This abstract concept might clear some things up for you as well. OOP FTW! [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
finding java difficult
Top