0% found this document useful (0 votes)
3 views3 pages

Java Unit Tutorial01

Uploaded by

tiobouraille20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Java Unit Tutorial01

Uploaded by

tiobouraille20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Java Unit Tutorial 12. Virtual functions should be defined in?

1. What is an object in c++?


It is a function of class Derived class
It is an instance of the class Base class
It is the data type of class Both base and derived class
It is part of the syntax of class. None
2. In which of the following is memory allocated for the 13. What are the total catch blocks that can be used using
objects? a single Try block?
RAM 1
ROM 2
Cache According to needs
HDD Maximum 256
3. On what basis is it determined, when a variable comes 14. Identify the scope resolution operator.
into existence in memory? :
Data type ::
Storage class ?:
Scope None
All of the above 15. What is cout?
4. Select the following which shows the correct Operator
constructor. Object
()class_name Function
-class_name Macro
class_name() 16. What is the implicit return type of constructor?
~class_name() No return type
5. To access data members of a class, which of the A class object in which it is defined.
following is used? void
Dot operator None
Arrow operator 17. What is the number of parameters that a default
Dot or arrow operator, as required constructor requires?
Dot, arrow, or direct call 0
Show Explanation 1
6. Total access specifiers in OOPS for C++ are? 2
1 3
2 18. What type of inheritance does single-level inheritance
3 support?
4 Compile-time
7. Total instances of an abstract class that can be Runtime inheritance
created? Multiple inheritances
0 Language independent
1 19. When is the object created with a new keyword?
4 At run time
8 At compile time
8. Total types of constructors in C++ are? Depends on the code
1 None
2 20. Which of the following functions can be inherited from
3 the base class?
4 Constructor
9. Total types of polymorphism in C++ are? Destructor
1 Static
2 None
3 21. Which of the following is not a type of inheritance?
4 Multiple
10. Under which pillar of OOPS do base class and derived Multilevel
class relationships come? Distributed
Polymorphism Hierarchical
Inheritance 22. Which of the following is not an oops concept?
Encapsulation Inheritance
Abstraction Compilation
11. Virtual function should be ________. Polymorphism
public Encapsulation
Private 23. Which type of inheritance is implemented in the
protected following code below?
default Single inheritance
Multilevel inheritance Virtual function
Hybrid inheritance Const function
35. Choose the option below which is shown by function
Multiple inheritances overriding
24. Who developed object-oriented programming? Abstraction
Dennis Ritchie
Charles Babbage Encapsulation
Alan Kay Polymorphism
Andrea Ferro Inheritance
25. Why is a virtual function mainly used to achieve? 36. Choose the option below which is used to free the
Function code polymorphism memory allocated for an object in C++.
Interpreter polymorphism Free()
Compile-time polymorphism unallocate()
Runtime polymorphism delete
26. Why is reusability a desirable feature? collect
Reduces compilation time 37. Choose the option below which is used to implement
Decreases testing time late binding.
Lowers maintenance cost Friend function
None Static function
27. Choose whether True or False: The constructor Virtual function
function can be constant. Const function
True 38. Choose the option below which overloads using the
False friend function.
Depends on implementation ()
None ->
28. Another name of the generic class is? *
Template class =
Final class 39. Choose whether True or False: Object cannot be
Abstract class passed as a function.
Efficient code True
29. By default, fields in a structure of a C program is? False
public Depends on implementation
Private None
protected 40. Another name of overloading is?
None Pseudo polymorphism
30. Choose the incorrect option below which is not a type Transient polymorphism
of constructor. Virtual polymorphism
Copy constructor Ad-hoc polymorphism
Friend constructor 41. Data members and member functions of a class are
Parameterized constructor private. default. True or False?
Default constructor True
31. Choose the option below for which instance of the False
class cannot be created. Depends on code
Anonymous class None
Parent class 42. Dynamic memory allocation can be done using?
Nested class calloc()
Abstract class malloc()
32. Choose the option below which can show Both (a) and (b)
polymorphism. create()
Overloading || 43. How do encapsulation and abstraction differ?
Overloading << Hiding and binding
Overloading && Binding and hiding
Overloading += Hiding and hiding
33. Choose the option below which describes the None
overloading of functions. 44. Identify the abstract data type among the following.
Ad-hoc polymorphism double
Virtual polymorphism int
Pseudo polymorphism class
Transient polymorphism string
34. Choose the option below which is not a member of the 45. Identify the feature using which, one object can
class. interact with another object.
Friend function Message passing
Static function Message reading
Data binding
Data transfer
46. Identify the feature which can be implemented using
encapsulation.
Abstraction
Encapsulation
Polymorphism
Inheritance

47. Identify the feature, which is used to reduce the use of


nested classes.
Binding
Inheritance
Encapsulation
Abstraction
48. Identify the incorrect constructor type.
Friend constructor
Default constructor
Parameterized constructor
Copy constructor
49. Identify the operators which cannot be overloaded.
?:
.(dot operator)
>>
Both A and B
50. Identify the option below which cannot be used with
the term “virtual”.
constructor
destructor
class
Member function
51. Identify the option below which is not a property of the
object.
Names
Attributes
Identity
Properties
52. Identify the pure object-oriented programming
language among the following.
C++
SmallTalk
Java
Python

You might also like