views:

105

answers:

3

Can anyone recommend good tutorial or a book on topics : class, methods, inheritance OOP etc .. to get general ideas .. and with some examples .. programming language is not important. tnx

A: 

The book Thinking in Java has been regarded as one of the best in this area even if you are not just interested in Java. You can buy it or can download the entire book as a PDF for free.

Loki Stormbringer
+1  A: 

The Wikipedia entry on object oriented programming explains these concepts nicely. Also, Sun's OOP tutorials are very clear and concise.

Asaph
+1  A: 

For a PHP explanation, which may be useful: http://www.hiteshagrawal.com/php/oops-in-php5-tutorial-exploring-inheritance

Basically, if you have a class, such as Restaurant, and you have certain properties in it, such as menu, number of tables and food type.

Then you want a fast food restaurant, so you extend restaurant and add the new properties that are for a fast-food restaurant.

Then, you want MacDonald's, so you extend fast food restaurant and add the menu.

Now you have a class that has all the properties it needs but you have made a flexible enough system to support any type of restaurant, so you can add to your application without doing a great deal of rework.

James Black