What is Object Oriented Feature
Oriented Capability are not utilized:
There are tendency of client-side operations to be discrete favorite procedures.
this.myData = 10;
this.myString = "my frist program";
var myClassObj1 = new MyClass();
var myClassObj2 = new MyClass();
myClassObj1.myData = 20;
myClassObj1.myString = "Obj1: my second program";
myClassObj2.myData = 30;
myClassObj2.myString = "Obj2: last program";
alert( myClassObj1.myData );
alert( myClassObj1.myString );
alert( myClassObj2.myData );
alert( myClassObj2.myString );
The Object Oriented programming is a computer programming paradigm. Object Oriented programming is that computer program may be seen as comprising a collection of individual units and objects, that is on each other, as opposed to a traditional view in which a program may be seen as a collection of functions or procedures, or simply as a list of instructions to the computer. Each object is capable of receiving messages, processing data, and sending messages to other objects. The Object-oriented programming is claimed to promote greater flexibility and maintains in programming, and is widely popular in large-scale software engineering. Further the more proponents of OOP claim that Object-Oriented programming is easier to learn those new to computer programming than previous approaches and that the OOP approach is often simpler to develop and to maintain, lending itself to more direct analysis or coding, and understanding of complex situations and procedures than other programming methods.
The Object an instance of a class and object is the run-time manifestation of a particular exemplar of a class. The class of dogs which contains breed types, an acceptable exemplar would only be the subclass 'collie'; "Lassie" would then be an object in that subclass. Each object has own data, though the code within a class a subclass or an object may be shared for economy. Thus, object-oriented languages must allow code to be reentrant.
The Object-Oriented program using the myclass as defined permits accessibility of its internal data representation as well as this methods and variable names global in scope increasing the risk of name collisions. The Object-Oriented program Encapsulation supports data hiding and the concept of viewing objects as self-contained entities providing services to consumers. The principle of information hiding is the hiding of The design decisions in a computer program that are most likely to change, thus protecting other parts of the program from change if the design decision is changed. Protecting is a design decision involves providing a stable interface which shields the remainder of the program from the implementation . Encapsulation is a modern programming languages of the principle of information hiding itself in a number of ways, including encapsulation and polymorphism.
var m_data = 15;
var m_text = "indian";
this.SetData = SetData;
this.SetText = SetText;
this.ShowData = DisplayData;
this.ShowText = DisplayText;
alert( m_data );
alert( m_text );
function SetData( myVal )
m_data = myVal;
function SetText( myText )
m_text = myText;
var Obj1 = new MyClass();
var Obj2 = new MyClass();
Obj1.SetData( 30 );
Obj1.SetText( "Obj1: my cuntry" );
Obj2.SetData( 60 );
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: December 18, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles