All Stories
Showing posts with label OOP Ques. Show all posts
Showing posts with label OOP Ques. Show all posts

Saturday, 11 January 2014

21.What is the difference between macro and iniine?
Inline follows strict parameter type checking, macros do not.
Macros are always expanded by preprocessor, whereas compiler may or may not replace the inline definitions.
22.How variable declaration in c++ differs that in c?
C requires all the variables to be declared at the beginning of a scope but in c++ we can declare variables anywhere in the scope. This makes the programmer easier to understand because the variables are declared in the context of their use.
23.What is multiple inheritance?
A class can inherit properties from more than one class which is known as multiple inheritance.
24.what is the use of virtual destructor in c++?
  • A destructor is automatically called when the object is destroyed.
  • A virtual destructor in C++ is used primarily to prevent resource leaks by performing a clean-up of the object.
25.What do you mean by reference variable in c++?
A reference variable provides an alias to a previously defined variable.
Data -type & reference-name = variable name

                <<<PREV                                                                                                       NEXT>>>

C++ Interview Question and Answers : 5

21.What is the difference between macro and iniine?
Inline follows strict parameter type checking, macros do not.
Macros are always expanded by preprocessor, whereas compiler may or may not replace the inline definitions.
22.How variable declaration in c++ differs that in c?
C requires all the variables to be declared at the beginning of a scope but in c++ we can declare variables anywhere in the scope. This makes the programmer easier to understand because the variables are declared in the context of their use.
23.What is multiple inheritance?
A class can inherit properties from more than one class which is known as multiple inheritance.
24.what is the use of virtual destructor in c++?
  • A destructor is automatically called when the object is destroyed.
  • A virtual destructor in C++ is used primarily to prevent resource leaks by performing a clean-up of the object.
25.What do you mean by reference variable in c++?
A reference variable provides an alias to a previously defined variable.
Data -type & reference-name = variable name

                <<<PREV                                                                                                       NEXT>>>

Posted at 22:05 |  by Pritam
16.What are the few advantages of Inline function?
  • It offers an improved macro facility.
  • By using the inline functions, the user can split a large function with many nested modules of statement blocks into many small inline functions.
17.What is copy constructor?
Copy constructor is a constructor function with the same name as the class and used to make deep copy of objects.
18.What is default constructor?
A default constructor is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.
19.What is a scope resolution operator?
The scope resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.
20.What is the difference between Object and Instance?
  • An instance of a user-defined type is called an object. We can instantiate many objects from one class.
  • An object is an instance of a class.
                   <<<PREV                                                                                                 NEXT>>>

C++ Interview Question and Answers : 4

16.What are the few advantages of Inline function?
  • It offers an improved macro facility.
  • By using the inline functions, the user can split a large function with many nested modules of statement blocks into many small inline functions.
17.What is copy constructor?
Copy constructor is a constructor function with the same name as the class and used to make deep copy of objects.
18.What is default constructor?
A default constructor is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.
19.What is a scope resolution operator?
The scope resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.
20.What is the difference between Object and Instance?
  • An instance of a user-defined type is called an object. We can instantiate many objects from one class.
  • An object is an instance of a class.
                   <<<PREV                                                                                                 NEXT>>>

Posted at 22:00 |  by Pritam

Wednesday, 8 January 2014

11.Define Constructors?
A constructor is a member function with the same name as its class. The constructor is invoked whenever an object of its associated class is created.It is called constructor because it constructs the values of data members of the class.
12.How variable declaration in c++ differs that in c?
C requires all the variables to be declared at the beginning of a scope but in c++ we can declare variables anywhere in the scope. This makes the programmer easier to understand because the variables are declared in the context of their use.
13.Define destuctors?
  • A destructor is called for a class object when that object passes out of scope or is explicitly deleted.
  • A destructors as the name implies is used to destroy the objects that have been created by a constructors.
  • Like a constructor , the destructor is a member function whose name is the same as the class name but is precided by a tilde.
14.What is a class?
A class is a collection of objects.
15.what is the difference between c & c++?
    C++ ia an object oriented programing but C is a procedure oriented programing.
  • C is super set of C++.
  • C can’t suport inheritance, function overloading, method overloading etc. but c++ can do this.
  • In c program the main function could not return a value but in the c++ the main function shuld return a value.

                 <<<PREV                                                                                                  NEXT>>>

C++ Interview Question and Answers : 3

11.Define Constructors?
A constructor is a member function with the same name as its class. The constructor is invoked whenever an object of its associated class is created.It is called constructor because it constructs the values of data members of the class.
12.How variable declaration in c++ differs that in c?
C requires all the variables to be declared at the beginning of a scope but in c++ we can declare variables anywhere in the scope. This makes the programmer easier to understand because the variables are declared in the context of their use.
13.Define destuctors?
  • A destructor is called for a class object when that object passes out of scope or is explicitly deleted.
  • A destructors as the name implies is used to destroy the objects that have been created by a constructors.
  • Like a constructor , the destructor is a member function whose name is the same as the class name but is precided by a tilde.
14.What is a class?
A class is a collection of objects.
15.what is the difference between c & c++?
    C++ ia an object oriented programing but C is a procedure oriented programing.
  • C is super set of C++.
  • C can’t suport inheritance, function overloading, method overloading etc. but c++ can do this.
  • In c program the main function could not return a value but in the c++ the main function shuld return a value.

                 <<<PREV                                                                                                  NEXT>>>

Posted at 20:12 |  by Pritam

6.What is encapsulation?
The wrapping up of data and functions into a single unit (called class) is known as encapsulation. Encapsulation containing and hiding information about an object, such as internal data structures and code.
7.What is message passing?
An object oriented program consists of a set of objects that communicate with each other. Message passing involves specifying the name of the object, the name of the function and the information to be sent.
8.What are tokens in C++?
    The smallest individual units of a program is known as tokens. c++ has the following tokens :
  • Keywords
  • Identifiers
  • Constants
  • Strings
  • Operators
9.What is the use of enumerated data type?
An enumerated data type is another user defined type which provides a way for attaching names to numbers thereby increasing comprehensibility of the code. The enum keyword automatically enumerates a list of words by assigning them values 0,1,2, and so on.
10.What is the use of default constructor?
A constructors that accepts no parameters is called the default constructor.If no user-defined constructor exists for a class A and one is needed, the compiler implicitly declares a default parameterless constructor A::A(). This constructor is an inline public member of its class. The compiler will implicitly define A::A() when the compiler uses this constructor to create an object of type A. The constructor will have no constructor initializer and a null body.

                   <<<PREV                                                                                             NEXT>>>          

C++ Interview Question and Answers : 2


6.What is encapsulation?
The wrapping up of data and functions into a single unit (called class) is known as encapsulation. Encapsulation containing and hiding information about an object, such as internal data structures and code.
7.What is message passing?
An object oriented program consists of a set of objects that communicate with each other. Message passing involves specifying the name of the object, the name of the function and the information to be sent.
8.What are tokens in C++?
    The smallest individual units of a program is known as tokens. c++ has the following tokens :
  • Keywords
  • Identifiers
  • Constants
  • Strings
  • Operators
9.What is the use of enumerated data type?
An enumerated data type is another user defined type which provides a way for attaching names to numbers thereby increasing comprehensibility of the code. The enum keyword automatically enumerates a list of words by assigning them values 0,1,2, and so on.
10.What is the use of default constructor?
A constructors that accepts no parameters is called the default constructor.If no user-defined constructor exists for a class A and one is needed, the compiler implicitly declares a default parameterless constructor A::A(). This constructor is an inline public member of its class. The compiler will implicitly define A::A() when the compiler uses this constructor to create an object of type A. The constructor will have no constructor initializer and a null body.

                   <<<PREV                                                                                             NEXT>>>          

Posted at 19:44 |  by Pritam

Tuesday, 8 October 2013

1.What is C++
C++ is created by Bjarne Stroustrup of AT&T Bell Labs as an extension of C, C++ is an object-oriented computer language used in the development of enterprise and commercial applications. Microsoft’s Visual C++ became the premier language of choice among developers and programmers.
2.What are the basic concepts of object oriented programming?
    It is necessary to understand some of the concepts used extensively in object oriented programming.These include
  • Objects
  • Classes
  • Data abstraction and encapsulation
  • Inheritance
  • Polymorphism
  • Dynamic Binding
  • Message passing
3.Define inheritance?
The mechanism of deriving a new class (derived) from an old class (base class) is called inheritance. It allows the extension and reuse of existing code without having to rewrite the code from scratch. Inheritance is the process by which objects of one class acquire properties of objects of another class.
4.Define polymorphism?
Polymorphism means one name, multiple forms. It allows us to have more than one function with the same name in a program.It allows us to have overloading of operators so that an operation can exhibit different behaviours in different instances.
5.What is encapsulation?
The wrapping up of data and functions into a single unit (called class) is known as encapsulation. Encapsulation containing and hiding information about an object, such as internal data structures and code.

                                                                                                            NEXT>>>

C++ Interview Question and Answers : 1

1.What is C++
C++ is created by Bjarne Stroustrup of AT&T Bell Labs as an extension of C, C++ is an object-oriented computer language used in the development of enterprise and commercial applications. Microsoft’s Visual C++ became the premier language of choice among developers and programmers.
2.What are the basic concepts of object oriented programming?
    It is necessary to understand some of the concepts used extensively in object oriented programming.These include
  • Objects
  • Classes
  • Data abstraction and encapsulation
  • Inheritance
  • Polymorphism
  • Dynamic Binding
  • Message passing
3.Define inheritance?
The mechanism of deriving a new class (derived) from an old class (base class) is called inheritance. It allows the extension and reuse of existing code without having to rewrite the code from scratch. Inheritance is the process by which objects of one class acquire properties of objects of another class.
4.Define polymorphism?
Polymorphism means one name, multiple forms. It allows us to have more than one function with the same name in a program.It allows us to have overloading of operators so that an operation can exhibit different behaviours in different instances.
5.What is encapsulation?
The wrapping up of data and functions into a single unit (called class) is known as encapsulation. Encapsulation containing and hiding information about an object, such as internal data structures and code.

                                                                                                            NEXT>>>

Posted at 22:48 |  by Pritam
© 2013 Knowledge To Grab. WP Theme-junkie converted by K-Grab
Blogger templates. Proudly Powered by Blogger.
back to top