Friday, June 7, 2019

Application of Statistics in Daily Life Report Essay Example for Free

Application of Statistics in Daily Life Report EssayInheritance is the process of creating new fellowshipes from the exist sectionalization or classes. InC++andC,classescan be defined as deriving from a tight class. Aderived classinherits in all of the ancestors protected and publicmethodsand selective information shares. With inheritance if a method is made virtual in the base class then the derived class can override it with distinct behaviour. This makes possiblepolymorphism. Types of classes renderingInC++andCOOP, a derivedclassis any class thatinheritsfrom any other derived class orbase class. DefinitionInC++andCOOP, the baseclassis the highest class and does notinheritfrom any other class. Other classes can inherit from a base class. They are calledderivedclasses. Forms of Inheritance Single Inheritance If a class is derived from a single base class, it is called as single inheritance. Multiple Inheritance If a class is derived from more than one base class, it is k nown as multiple inheritance Multilevel Inheritance The classes can also be derived from the classes that are already derived. This type of inheritance is called multilevel inheritance.Hierarchical Inheritance If a number of classes are derived from a single base class, it is called as hierarchical inheritance Definition of classWhen you define a class, you define a blueprint for a data type. This doesnt actually define any data, but it does define what the class name means, that is, what an tendency lens glass of the class will consist of and what operations can be performed on such an object. folkes amp Objects in Detail Class member functions A member function of a class is a function that has its definition or its prototype within the class definition like any other variable.Class access modifiers A class member can be defined as public, private or protected. By default members would be assumed as private Constructor amp destructor A class constructor is a finical function in a class that is called when a new object of the class is created. A destructor is also a special function which is called when created object is deleted. C++ copy constructor The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previouslyAfriend function is permitted full access to private and protected members of a class. C++ inline functions With an inline function, the compiler tries to spread the code in the body of the function in place of a call to the function. The this pointer in C++ Every object has a special pointerthiswhich points to the object itself. Pointer to C++ classes A pointer to a class is done exactly the same way a pointer to a structure is. In fact a class is really just a structure with functions in it. Static members of a class Both data members and function members of a class can be declared as static. ENCAPSULATION DefinitionInObject Oriented Programming,encaps ulation is an attribute ofobjectdesign. It means that all of the objects data is contained and hidden in the object and access to it restricted to members of that class. C Programming C++ Programming C follows the procedural programming paradigm C++ is a multi-paradigm language(procedural as well as object oriented)In C language focus on procedure and steps. C++ focuses on the data quite than the process In C data hiding and data security is not possible. Data hiding and data security is present. C uses Top-Down approch C++ uses Bottom-Up approach C is a function driven programming language C++ is a object driven programming language C does not place upright overloading concept C++ supports overloading concepts like operator overloading and function overloading C does not support namespaces concept CPP supports Namespaces concept. C not support riddance handling C++ supports Exception Handling C is structured programming language C++ is object oriented programming language. C does not support inheritance, reusability, polymorphism, data abstraction CPP supports inheritance, reusability, polymorphism, data abstraction. C language only support Early binding CPP supports both Early and Late binding C uses bill input, output functions like scanf and printf. C++ uses input function cin and output function is cout. There are all data is available to end user. No data security There is data abstraction. Not complete data is available to End user

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.