Data Encapsulation is also known as data hiding. Many programmers believe that delete this is a valid construct. A reader pointed out that a class can ensure that its objects are instantiated on the heap by making its destructor private. As far as the instantiating program is concerned, the object remains in scope and continues to exist even though the object did itself in. When is a template a better solution than a base class? 0000000016 00000 n 0000002021 00000 n xڼS�KQ>w��h ����:�� E��E��*ij-�5Ƙm���F����5n?������"*�Ȑ$�"��53Z��aE$ѹ3��?Н�w���s����] ��]: ]?p�wpӃ�v�g���\�Y��=�&��R�]��s2n�:�.s�a>ꌮ�u��[g"��M9�נ�����zSD4 �3̢�9��壠����/�T��Š�D���3���$T+;���pr������2���`���iO�zǚӷW�t-X3&�6��q�Փ��S��W�#:z���U��l&��j,�)�0'��8,6��c]S��9�Z���׾ϖWָ����K�|%����ˤ�\��al�K]����)U��]�g/R!S���Ś�^�Y��/�J8,���~{�ˢ�%Ƥ���w|7�G1���;h��v>�}��䠰 Then you should explain how the extern “C” linkage specification statement turns that feature off during compilation so that the linker properly links function calls to C functions. Exceptions are in the mainstream of C++ now, so most programmers, if they are familiar with setjmp and longjmp, should know the difference. 0000005588 00000 n It is a language used to model OO problem spaces and solutions. COMPUTER SCIENCE ENGINEERING Interview Questions and Answers pdf [CSE] free download for freshers,cse interview questions with answers campus, ebook 202 25 What is data encapsulation ? 0000006765 00000 n When you diagram these relationships, it becomes apparent that multiple inheritance is an intuitive way to model this common problem domain. This would be done in the object’s class definition. xref What differs is the type of object on the right-hand side of these messages. The sub-class has the option of modifying these characteristics in order to make a different but fundamentally related class from the super-class. (Some readers had not heard the term, “scope resolution operator,” but they knew what :: means. By discussing the requirements with respect to data member pointers that point to dynamically allocated resources, you demonstrate a good grasp of the problem. There are other relationships. First, if it executes in a member function for an extern, static, or automatic object, the program will probably crash as soon as the delete statement executes. 34. Please provide computer science answer keys of 10 July 2016 ugc net exam. Not all assets are vehicles. Such a member is accessed using Classname.Membername (as opposed to Object.Membername). Explain the syntax of try blocks, catch exception handlers, and throw expressions. An object is a package that contains related data and instructions. 2) What are the layers of the OSI reference model? If you do not provide an overloaded assignment operator for the class, the compiler creates a default member-by-member assignment operator. Computer Science. There is no portable way for an object to tell that it was instantiated on the heap, so the class cannot assert that its object is properly instantiated. An object’s message protocol is the exact form of the set of messages to which the object can respond. Inheritance is the process of deriving classes from other classes. The throw operation calls the destructors for automatic objects instantiated since entry to the try block. 0000004171 00000 n The USESA relationship is when one class uses the services of another. 0000008395 00000 n Not all buildings are assets. Your answer should reflect an understanding of the behavior described in the answer just given. The default member and base class access specifiers are different. Some real-estate holdings are buildings. In my experience, classes that use delete this when objects are instantiated by users usually spawn bugs related to the idiom, most often when a program dereferences a pointer to an object that has already deleted itself. For example, an Employee “has a” Salary, therefore the Employee class has the HASA relationship with the Salary class. H���Ao�0���. Stress this understanding because your interviewer might share the common bias against multiple inheritance that many object-oriented designers hold. Practice Important Computer Questions and Answers for Competitive Exams based on asked questions in previous papers. Polymorphism allows for a generic use of method names while providing specialized implementations for them. Internally, however, it knows that it must treat the two types of objects differently in order to obtain the same overall response. 38. I got a lot of mail about this issue. Dear Readers, We are sharing PDF compilation of more than fifteen hundreds Computer Objective Questions / MCQs which are enough to prepare computer section for Bank(IBPS PO, IBPS Clerk, SBI … Reply ... antony 8 November 2017 at 11:14. An Employee ISA Person. The access privileges in C++ are private, public and protected. What is an object in C++? The former is an integer object (5) while the later is a floating point object (5.1). 23. When a class member is declared to be of a static type, it means that the member is not an instance variable but a class variable. The greatest advantage of inheritance is that it promotes generic design and code reuse. It is not unusual for C and C++ programmers to be unfamiliar with setjmp/ longjmp. Some of them have even written books about C++. Employee is derived from Person. You should understand, however, that multiple inheritance, like a chainsaw, is a useful tool that has its perils, needs respect, and is best avoided except when nothing else will do.