• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

OOP Interview Questions Answers

Question - 11 : - Object Oriented : Essentials and History

Answer - 11 : - An object-oriented programming language (also called an OO language) is one that allows or encourages, to some degree, object-oriented programming methods. Simula (1967) is generally accepted as the first language to have the primary features of an object-oriented language. It was created for making simulation programs, in which what came to be called objects were the most important information representation. Smalltalk (1972 to 1980) is arguably the canonical example, and the one with which much of the theory of object-oriented programming was developed. OO languages can be grouped into several broad classes, determined by the extent to which they support all features and functionality of object-orientation and objects: classes, methods, polymorphism, inheritance, and reusability. * Languages called “pure” OO languages, because everything in them is treated consistently as an object, from primitives such as characters and punctuation, all the way up to whole classes, prototypes, blocks, modules, etc. They were designed specifically to facilitate, even enforce, OO methods. Examples: Smalltalk, Eiffel, Ruby. * Languages designed mainly for OO programming, but with some procedural elements. Examples: Java, Python. * Languages that are historically procedural languages, but have been extended with some OO features. Examples: C++, Fortran 2003, Perl. * Languages with most of the features of objects (classes, methods, inheritance, reusability), but in a distinctly original, even elegant, form. Examples: Oberon, and successor Oberon-2. * Languages with abstract data type support, but not all features of object-orientation, sometimes called object-based languages. Examples: Modula-2 (with excellent encapsulation and information hiding), Pliant. Inheritance and polymorphism are usually used to reduce code bloat. Abstraction and encapsulation are used to increase code clarity, quite independent of the other two traits.

Question - 12 : - Differentiate the class representation of Booch, Rumbaugh and UML?

Answer - 12 : - If you look at the class representation of Rumbaugh and UML, It is some what similar and both are very easy to draw.

Question - 13 : - Can a method be overloaded based on different return type but same argument type ?

Answer - 13 : - No, because the methods can be called without using their return type in which case there is ambiguity for the compiler.

Question - 14 : - What is the difference between procedural and object-oriented programs?

Answer - 14 : - 1. In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOP program, unit of program is object, which is nothing but combination of data and code. 2. In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible with in the object and which in turn assures the security of the code.

Question - 15 : - What are the advantages of OOPL?

Answer - 15 : - Object oriented programming languages directly represent the real life objects. The features of OOPL as inheritance, polymorphism, encapsulation makes it powerful.

Question - 16 : - What do u meant by “SBI” of an object?

Answer - 16 : - SBI stands for State, Behavior and Identity. Since every object has the above three. State: It is just a value to the attribute of an object at a particular time. Behaviour:It describes the actions and their reactions of that object.Identity: An object has an identity that characterizes its own existence. The identity makes it possible to distinguish any object in an unambiguous way, and independently from its state.

Question - 17 : - Who were the three famous amigos and what was their contribution to the object community?

Answer - 17 : - The Three amigos namely, James Rumbaugh (OMT): A veteran in analysis who came up with an idea about the objects and their Relationships (in particular Associations). Grady Booch: A veteran in design who came up with an idea about partitioning of systems into subsystems. Ivar Jacobson (Objectory): The father of USECASES, who described about the user and system interaction.

Question - 18 : - What are inner class and anonymous class?

Answer - 18 : - Inner class : classes defined in other classes, including those defined in methods are called inner classes. An inner class can have any accessibility including private. Anonymous class : Anonymous class is a class defined inside a method without a name and is instantiated and declared in the same place and cannot have explicit constructors.

Question - 19 : - Differentiate persistent & non-persistent objects?

Answer - 19 : - Persistent refers to an object’s ability to transcend time or space. A persistent object stores/saves its state in a permanent storage system with out losing the information represented by the object. A non-persistent object is said to be transient or ephemeral. By default objects are considered as non-persistent.  

Question - 20 : - What do you meant by static and dynamic modeling?

Answer - 20 : - Static modeling is used to specify structure of the objects that exist in the problem domain. These are expressed using class, object and USECASE diagrams. But Dynamic modeling refers representing the object interactions during runtime. It is represented by sequence, activity, collaboration and statechart diagrams

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners