Vous êtes sur la page 1sur 8

Brief History

Object-oriented programming (OOP) is a computer science term used to characterize a programming language that began development in the 1960s. It describes the methodology of using objects as the foundation for computation. By the 1980s, OOP rose to prominence as the programming language of choice, exemplified by the success of C++. Currently, OOPs such as Java, J2EE, C++, C#, Visual Basic.NET, Python and JavaScript are popular OOP programming languages.

Concept of OOP
OOP is widely accepted as being far more flexible than other computer programming languages. OOPs use three basic concepts as the fundamentals for the programming language: classes, objects and methods. Additionally, Inheritance, Abstraction, Polymorphism, Message Passing are also significant concepts within object-oriented programming languages.

Designed By Sayantan Basu

Objects are key to understanding object-oriented technology. In an objectoriented environment, everything is considered as an object. Look around right now and you'll find many examples of real-world objects: your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages).

Designed By Sayantan Basu

A class is a template for an object. One might say that a class is a blueprint that describes the nature of object. A user-defined datatype that contains variables, properties of an object. A class defines abstract characteristics of an object, including its characteristics (attributes, fields or properties) and the what it can do (behaviors, methods, operations or features). The instance is the actual object created at run-time.

Designed By Sayantan Basu

Encapsulation provides the mechanism for hiding information from unwanted outside access and attaching that information to only methods that need access to it. This binds data and operations tightly together and separates them from external access that may corrupt them intentionally or unintentionally. Encapsulation is achieved by declaring variables with access modifiers in a class. There are mainly three types of access modifiers : Private Private keyword gives access to data to only member functions of the class. Protected A next level of accessibility is provided by the Protected keyword which gives the derived classes the access to the member variables of the base class a variable declared as Protected can at most be accessed by the derived classes of the class. Public Any method from outside or inside the class can access this type of data.

Designed By Sayantan Basu

Abstraction is the process of identifying common patterns that have systematic variations. An abstraction represents the common pattern and provides a means for specifying which variation to use. An abstract class is a parent class that allows inheritance but can never be instantiated. Abstract classes contain one or more abstract methods that do not have implementation. Abstract classes allow specialization of inherited classes. Also we can say abstraction refers to the act of representing essential features without including the background details or explanations.

Designed By Sayantan Basu

Inheritance is a process in which a class inherits all the state and behavior of another class. This type of relationship is called child-Parent or is-a relationship. "Subclasses" are more specialized versions of a class, which inherit attributes and behaviors from their parent classes, and can introduce their own. Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different. Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In this example, Bicycle now becomes the superclass of MountainBike, RoadBike, and TandemBike.

Designed By Sayantan Basu

Polymorphism is a Latin word which describes 'poly' means many 'morphs' means forms. Polymorphism in object-oriented programming is the ability of objects belonging to different data types to respond to calls of methods of the same name, each one according to an appropriate type-specific behavior.

Designed By Sayantan Basu

Static Variable Static variables continue to exist even after the block in which they are defined terminates. Thus, the value of a static variable in a function is retained between repeated function calls to the same function. The scope of static variables is identical to that of normal variables, i.e. it is local to the block in which it is defined; however, the storage allocated becomes permanent for the duration of the program. Static Class A static class is basically the same as a non-static class, but there is one difference : a static class cannot be instantiated. In other words, you cannot use the new keyword to create a variable of the class type. Because there is no instance variable, you access the members of a static class by using the class name itself. For example, if you have a static class that is named UtilityClass that has a public method named Method A, you call the method as UtilityClass.MethodA(); Static Methods Method associated with a type rather than an instance of the type. Static methods are accessible via the type name without instantiation.

Designed By Sayantan Basu