Skip to main content

12th HSC free notes of c++ language theory part 3

 Object oriented programming

• Object oriented programming is an approach that provides a way of modularizing programs by creating partitioned memory area for both data and function that can be used as templates for creating copies of such modules on demand .
• In object oriented programming the program is designed around the data being operated upon rather than upon the operation themselves.
• OOP allows to decompose a problem into a number of entities called object and then build data and function around these entity.
• When program is executed the object interact by sending message to one another
• Each object contains data and code to manipulate the data .

Features of OOP :
• Program are divided into number of object.
• Data is hidden and cannot be accessed by external function
• Object may communicate with each other through function
• New data and function can be easily added wherever required.
Object :
• Object are the basic runtime entity in object oriented system .
• For e.g they may represent a person , a place , a bank.
• Programming problem is analyzed in term of object and the nature of communication between them .
• Program object should be chosen such that they match closely with the real world object .

Class :
• Class is way to bind a data and is associated functions together.
• The entire set of data and code of an object can be made an user define datatype with the help of class
• Infact an object is nothing but a variable whose datatype is class
• Once a class has been define user define any number of object belonging to that class
• Class is a collection of object of similar type.

What are friendly function? Give the characteristics of a friendly function .
 C++ allows the common function to be made friendly with more than one classes , thereby allowing the function to have access to the private data of class . Such a function need not be a member of any classes.
 Non-member function cannot have access to the private data of a class . However , there could be a situation where user would like two classes to share a particular function. At this situation friend function is used.
 The keyboard “ friend ” declare the function to be friendly with that class. This function is defined as a normal c++ function . The function definition does not use class – name , keyboard friend or scope resolution operator.
 A friend function has following characteristics :
(1) It is not in the scope of the class to which it has been declared as friend .
(2) since it is not in scope of the class, it cannot be called by using object of that class . It is called like a normal c++ function .
(3) It can be declared either in public or the private part of a class without affecting is meaning .
(4) Usually , it has the objects as arguments.
(5) It cannot access the member function directly and has to use an object name and dot operator with each member name .

Comments

Popular posts from this blog

12th topicfor 2020 and 2021 batch HTML table part 3 free notes

  Html Table  ✓ A table can be created using <table></table> ✓ A table consists of rows and column  ✓ The row is to be define 1 st and then cells or column inserted into row  from left to right . ✓ For creating row <tr></tr> tag is used ✓ For table data <td> </td>tag is used ✓ For table heading i.e. row heading <th></th> tag is used. Basic table structure <table> <tr> <td>cs academy </td> <td>html</td> </tr> <tr> <td>.data structure</td> <td>operating system</td> </tr> </table> Important tags  ▪ <img src=“ ”> : use to add images on our web page. ▪ <a href=“ ”> use for hypertext link , called as anchor tag.. ▪ <sup></sup>. :use to show text in super script for 1st ▪ <sub></sub> : use to show text in subscript form. ▪ <strike></strike> : text have line drawn throught the middle ...

Free notes Operating system 12th HSC windows 98

  MAIN FEATURES OF WINDOWS 98 ➢Easier to use : ➢Windows 98 is a single user multitasking operating system  ➢Searching is easy in this os. ➢A file can be opened by a single click ➢It allows us to use multiple monitor with single computer ➢New hardware can be easily installed. MAIN FEATURES  Faster : • Windows and program open faster than in windows 95 • The computer speed and efficiency can be easily improved by single maintainance. True web integration : • It can be easily connected to internet • Web pages can be viewed in any window • Internet conferances can be arranged

Free notes of all naming reactions .(handwritten notes jee, neet, mht-cet)

All naming reactions  (Handwritten notes.)                   organic chemistry naming reactions.