Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Funny Pictures MCA Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter




C++ Interview Questions with Answers - Set 4


Posted Date: 09 Feb 2008    Resource Type: Articles/Knowledge Sharing    Category: General

Posted By: Bala       Member Level: Diamond
Rating:     Points: 5



C++ Interview Questions with Answers - Set 4

Define precondition and post-condition to a member function.
Ans :Precondition:A precondition is a condition that must be true on entry to a member function. A class is used correctly if preconditions are never false. An operation is not responsible for doing anything sensible if its precondition fails to hold.
For example, the interface invariants of stack class say nothing about pushing yet another element on a stack that is already full. We say that isful() is a precondition of the push operation.
Post-condition:A post-condition is a condition that must be true on exit from a member function if the precondition was valid on entry to that function. A class is implemented correctly if post-conditions are never false.
For example, after pushing an element on the stack, we know that isempty() must necessarily hold. This is a post-condition of the push operation..

What are the conditions that have to be met for a condition to be an invariant of the class?
Ans :1. The condition should hold at the end of every constructor.
2. The condition should hold at the end of every mutator(non-const) operation..

Name some pure object oriented languages.
Ans :Smalltalk,Java,Eiffel,Sather..

Name the operators that cannot be overloaded.
Ans :sizeof, *, ->, ::, ?: .

What is an orthogonal base class?
Ans :If two base classes have no overlapping methods or data they are said to be independent of, or orthogonal to each other. Orthogonal in the sense means that two classes operate in different dimensions and do not interfere with each other in any way. The same derived class may inherit such classes with no difficulty..

What is a container class? What are the types of container classes?
Ans :A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behavior and a well-known interface. A container class is a supporting class whose purpose is to hide the topology used for maintaining the list of objects in memory. When a container class contains a group of mixed objects, the container is called a heterogeneous container; when the container is holding a group of objects that are all the same, the container is called a homogeneous container..

What is a protocol class?
Ans :An abstract class is a protocol class if:
1. It neither contains nor inherits from classes that contain member data, non-virtual functions, or private (or protected) members of any kind.
2. It has a non-inline virtual destructor defined with an empty implementation,
3. All member functions other than the destructor including inherited functions, are declared pure virtual functions and left undefined..

What is a mixin class?
Ans :A class that provides some but not all of the implementation for a virtual base class is often called mixin. Derivation done just for the purpose of redefining the virtual functions in the base classes is often called mixin inheritance. Mixin classes typically don't share common bases..




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: C++ Interview Questions with Answers - Set 3
Previous Resource: what is love
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources

Watch TV Channels



Contact Us    Editors    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.