What is an object?
An object is an instance of a class. This instance may be used to access the members of the class. It is pretty easy to define an object.
An object is an instance of a class. This instance may be used to access the members of the class. It is pretty easy to define an object.
A class is an organized store-house in object-oriented programming that gives coherent functional abilities to a group of related code. It is the definition of an object, made up of software code. Using classes, we may wrap data and behaviour together (Encapsulation). We may define classes in terms of classes… Continue reading
A pure virtual member function is a member function that the base class forces derived classes to provide. Normally these member functions have no implementation. Pure virtual functions are equated to zero.
As the name suggests, the function acts as a friend to a class. As a friend of a class, it can access its private and protected members. A friend function is not a member of the class. But it must be listed in the class definition.
Overloading: Overloading happens when two or more function have the same function name but different return type and parameter. eg: int sum(int a int b); int sum(int a int b int c); The overloading happens in the same class i e these function should be in the same class. Return… Continue reading
Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching the pointer type) is called on the object. There is a simple solution to this problem declare a virtual base-class destructor…. Continue reading
It permits code re-usability. Re-usability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.
Constructors A constructor is a special class member that is executed when a new object is created. The constructor’s job is to initialize all of the public and private state of the new object and to perform any other tasks that the programmer requires before the object is used. In… Continue reading
Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects. A Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class… Continue reading
JavaScript Event Delegation is a technique you may have heard of. It’s a different way of using event handlers that offers clear benefits and is becoming more popular amongst web developers. I’ll give a brief overview of event delegation in JavaScript, along with why you should consider it. Note that… Continue reading