Link popularity strategies for new sites are a major factor for success on the internet. The websites with good links have increased amounts of traffic and higher page rankings with the search engines. It is …
Read the full story »
Object-oriented Programming (OOP) was introduced to overcome flaws in the procedural approach to programming, such as lack of re-usability and maintainability. OOP has a number of features that makes it different from standard procedural languages. Some of these features are as follows:-
1. It emphasizes on the data rather than the procedures.
2. It can hide certain critical data to prevent access by any unauthorized section.
3. It allows new data and functions to be easily added whenever required.
Object-oriented programming has various advantages over procedural programming. Some of these are:
1. It enables code re-usability.
2. It provides a clear modular structure for programs, which makes it good for hiding data.
3. It enables the user to maintain and modify existing code easily as new objects can be created by making minor changes to existing ones.
Object-oriented programming provides 4 features that make it distinct and powerful as compared to procedural programming. These features are:-
Ø Abstraction
Consider an example of a car that consists of a number of individual parts. Explaining the details of each and every individual part to the user can be difficult and complex. Further, the user might not be able to understand such technical details. However, by considering the role of the user in using the car, only the necessary features of the car can be explained. This is called abstracting information about an entity. Similarly in C#, the feature of describing only the relevant information about an object is called abstraction.
Ø Encapsulation
Consider an example of an ATM machine, the user inserts the ATM card and enters his/her pin number. If the pin number is wrong, an error message is displayed. Otherwise, the pin number is accepted and the process continues. However, the login process consists of three steps. They include:-
1. Reading the ATM card number.
2. Validating the card and pin numbers.
3. Receiving the result of whether the login is valid or not.
The validation process is not visible to the user, as it is hidden so that it cannot be accessed or modified for security reasons. Similarly in C#, certain critical details of a class can be hidden from the other classes. This feature of data hiding is termed as encapsulation.
Ø Inheritance
Consider an example of a family of 3 members having a mother, father and their daughter named Jill. Jill’s father is tall and dark and his mother is short and fair. Jill is fair and tall, so he is said to have inherited the features of the father and mother both. Similarly, in programming languages like C#, inheritance is the process by which an object of one class acquires the characteristics and behaviors of the object of another class.
A class can inherit an existing built-in class or a user-defined class only if there exists a relation between the two classes. These relations are:
1. Is a: Student is a human being. Here, the Human class can be the base class for the Student class.
2. Type of: Mammal is a type of an animal. Here, the Animal class can be the base class for the Mammal class.
3. Part of: Gears are part of a car. Here, the Car class can be the base class for the Gears class.
Ø Polymorphism
Consider an example of microwave oven. The oven can be used to warm food or bake items such as cake and biscuits. Thus, it is seen that the same device can be used for performing different tasks.
Similarly in C#, there can be multiple methods declared with the same name either with different parameters or body. Methods with same name and different parameters are known as overloaded methods whereas methods with same name but different body are known as overridden methods.
Thus OOP has various advantages over procedural programming. Some of these are:
1. It enables code re-usability.
2. It provides a clear modular structure for programs, which makes it good for hiding data.
3. It enables the user to maintain and modify existing code easily as new objects can be created by making minor changes to existing ones.
I Hope that this article has given you an clear idea about OOP. For any queries please feel to write to me and do post your valuable comments it will help me to understand your needs better. Till then keep blogging .
Sony Ericsson is launching an new business class cell phone against one of the best in the market leader for business class cell phones, blackberry. Some information about this latest gadget to keep you updated Sony’s cell phone’s so check this out.
Apple has once again turned our heads with their recently revealed iPad device. Given the precarious history of Tablet PC’s, a category that the iPad has been hastily banded to, many are asking what more …
Now you can send SMS using Google Voice to one or multiple recipients, yes Google add this new feature for Google Voice which enables the users to send SMS text messages.
Check the image for reference, …
TEDIndia, Pranav Mistry gives a demo of several tools that help physical world interaction with the world of data including a deep look at his Sixtensense technology devices and a new face for using laptop …
One of the most affordable touch screen mobile from Nokia is Nokia 5230, Nokia has launched this phone recently, this mobile is best for the users who can’t afford big money for a high end …
Effort Rules Fortune Follows
Effort and Fortune are the most important terms of an Individual to lead his life in an easy and indestructible manner.
But the people believe mostly on fortune rather than effort. This plays …
Two days of Beautiful Life^
Might be a Day three…..!
Live ur Life for Beautiful Two^
Don’t rely upon Day Three….!!!
Voice Chat in Yahoo Messanger :
How to have a voice chat in yahoo messanger ?
Voice chat is very useful component and eminent feature of yahoo messanger which enables the …
GO GREEN CONCEPT
Go green Concept: This is what we are lacking behind. we have all the Best Resources in our earth but we r not utilising it properly and may also sometimes mis-utilising it. Everyone …
INDIAN RAILWAY TRAINS TIMETABLE
FOR MMTS TRAINS
FOR EXPRESS & VARIOUS OTHER TRAINS
MAP OF LOCAL TRAINS