Vous êtes sur la page 1sur 5

KAMARAJ COLLEGE OF ENGINEERING AND TECHNOLOGY VIRUDHUNAGAR

Subject Code: CS510

Class

: III EEE

Subject Name: Object Oriented Programming lab VIVA QUESTIONS C++

Staff Name: K.Dhanalakshmi

1. What is the Syntax for declaring variable? 2. What is the syntax for defining constants/ 3. What are the different types of constants? 4. State some of the escape sequence 5. What is the use of comments? 6. Give the syntax for defining a string 7. Name some of the string functions 8. Define class 9. What is constructor? 10. How will you create dynamic constructor? 11. What is the syntax for accessing members of a class? 12. What is inline function? 13. What is destructor? 14. How will you define a class? 15. What are the different types of constructor? 16. How will you overload constructor? 17. Define polymorphism 18. What are the different types of polymorphism? 19. Give an example for function overloading 20. Define Parameterized constructor. 21. What are the components of a function? 22. What is the syntax for pass by value? 23. What is the syntax for pass by reference? 24. What is the use of friend function? 25. What is the use of friend class? 26. Define access specifiers 27. How will you pass object as argument to a function? 28. Syntax for objects as function argument pass by value 29. Syntax for objects as function argument pass by address 30. Syntax for objects as function argument pass by reference 31. What is the syntax for operator overloading? 32. Syntax for overloading unary using member function 33. Syntax for overloading unary using friend function 34. Syntax for overloading binary using member function 35. Syntax for overloading binary using friend function 36. Define copy constructor 37. Define method overloading

38. Define method overriding 39. What are the different types of polymorphism/ 40. Define operator overloading 41. Define inheritance 42. What are the types of inheritance? 43. What is meant by single inheritance and multiple inheritance? 44. Define virtual function 45. Define pure virtual function 46. How will you access ,members in derived class/ 47. What is super class? 48. What are the types of exception/ 49. Define try and catch exception 50. Define non member function in function template JAVA 1. 1.Define bytecode 2. 2.Define object 3. Define class 4. Define virtual machine 5. What is array 6. Define inheritance 7. Define single inheritance 8. Define hybrid inheritance 9. Define interfaces 10. Define Exception 11. What is Thread? 12. Define Streams 13. Define Synchronisation 14. What is final 15. What is abstract class 16. What is static in Java 17. Explain different ways of using thread 18. Define Garbage collection 19. What are input streams 20. Define output streams

Viva Questions and Answers 1. Explain about multiple inheritance? Inheritance involves inheriting characteristics from its parents also they can have their own characteristics. In multiple inheritances a class can have characteristics from multiple parents or classes. A sub class can have characteristics from multiple parents and still can have its own characteristics. 2. Explain the mechanism of composition? Composition helps to simplify a complex problem into an easier problem. It makes different classes and objects to interact with each other thus making the problem to be solved automatically. It interacts with the problem by making different classes and objects to send a message to each other. 3. Explain about overriding polymorphism? Overriding polymorphism is known to occur when a data type can perform different functions. For example an addition operator can perform different functions such as addition, float addition etc. Overriding polymorphism is generally used in complex projects where the use of a parameter is more. 4. Explain about inheritance? Inheritance revolves around the concept of inheriting knowledge and class attributes from the parent class. In general sense a sub class tries to acquire characteristics from a parent class and they can also have their own characteristics. Inheritance forms an important concept in object oriented programming. 5. Explain the rationale behind Object Oriented concepts? Object oriented concepts form the base of all modern programming languages. Understanding the basic concepts of object-orientation helps a developer to use various modern day programming languages, more effectively. 6. .Explain about instance in object oriented programming? Every class and an object have an instance. Instance of a particular object is created at runtime. Values defined for a particular object define its State. Instance of an object explains the relation ship between different elements. 7. Explain about encapsulation? Encapsulation passes the message without revealing the exact functional details of the class. It allows only the relevant information to the user without revealing the functional mechanism through which a particular class had functioned. 8. Explain about polymorphism? Polymorphism helps a sub class to behave like a parent class. When an object belonging to different data types respond to methods which have a same name, the only condition being that those methods should perform different function. 9. Explain about object oriented databases? Object oriented databases are very popular such as relational database management systems. Object oriented databases systems use specific structure through which they extract data and they combine the data for a specific output. These DBMS use object oriented languages to make the process easier. 10. What are all the languages which support OOP? There are several programming languages which are implementing OOP because of its close proximity to solve real life problems. Languages such as Python, Ruby, Ruby on rails, Perl, PHP, Cold fusion, etc use OOP. Still many languages prefer to use DOM based languages due to the ease in coding. 11. Explain the implementation phase with respect to OOP?

The design phase is followed by OOP, which is the implementation phase. OOP provides specifications for writing programs in a programming language. During the implementation phase, programming is done as per the requirements gathered during the analysis and design phases. 12. Explain about Object oriented programming? Object oriented programming is one of the most popular methodologies in software development. It offers a powerful model for creating computer programs. It speeds the program development process, improves maintenance and enhances reusability of programs. 13. Explain about a class? Class describes the nature of a particular thing. Structure and modularity is provided by a Class in object oriented programming environment. Characteristics of the class should be understandable by an ordinary non programmer and it should also convey the meaning of the problem statement to him. Class acts like a blue print. 14. How to define an Abstract class? Answer: A class containing abstract method is called Abstract class. An Abstract class can't be instantiated. 15. How to define an Interface? Answer: In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface. 16. Explain the user defined Exceptions? Answer: User defined Exceptions are the separate Exception classes defined by the user for specific purposed. An user defined can created by simply subclassing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same way as normal exceptions. 17. Explain garbage collection? Answer: Garbage collection is one of the most important feature of Java. Garbage collection is also called automatic memory management as JVM automatically removes the unused variables/objects (value is null) from the memory. User program cann't directly free the object from memory, instead it is the job of the garbage collector to automatically free the objects that are no longer referenced by a program. Every class inherits finalize() method from java.lang.Object, the finalize() method is called by garbage collector when it determines no more references to the object exists. 18. Question: Explain the Encapsulation principle. Answer: Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper. 19. Explain the Polymorphism principle. Answer: The meaning of Polymorphism is something like one name many forms. Polymorphism enables one entity to be used as as general category for different types of actions. The specific action is determined by the exact nature of the situation. The concept of polymorphism can be explained as "one interface, multiple methods".

20. What is garbage collection? What is the process that is responsible for doing that in java? - Reclaiming the unused memory by the invalid objects. Garbage collector is responsible for this process 21. What kind of thread is the Garbage collector thread? - It is a daemon thread. 22. What is a daemon thread? - These are the threads which can run without user intervention. The JVM can exit when there are daemon thread by killing them abruptly. 23. How will you invoke any external process in Java? Runtime.getRuntime().exec(.) 24. What is the finalize method do? - Before the invalid objects get garbage collected, the JVM give the user a chance to clean up some resources before it got garbage collected. 25. What is the purpose of Void class? - The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void. 26. What is reflection? - Reflection allows programmatic access to information about the fields, methods and constructors of loaded classes, and the use reflected fields, methods, and constructors to operate on their underlying counterparts on objects, within security restrictions. 27. What is the base class for Error and Exception? - Throwable 28. What is a package? - To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability.

Vous aimerez peut-être aussi