Question: 17. What is difference between Abstract class and Interface(Abstract vs Interface)? (5 Marks) 18. Find which of the following uses encapsulation? - (5Marks) a.
17. What is difference between Abstract class and Interface(Abstract vs Interface)?
– (5 Marks)
18. Find which of the following uses encapsulation? - (5Marks)
a. void main(){ int a; void fun( int a=10; cout<b. class student{ int a; public: int b;};
c. class student{int a; public: void disp(){ cout<d. struct topper{ char name[10]; public : int marks; }
19. Consider the following code and select the correct option: -(5 Marks)
class student{
int marks;
public : int* fun()
{
return &marks;
}
};
main()
{
student c;
int *ptr = c.fun();
return 0;
}
a. This code is good to go
b. This code may result in undesirable conditions
c. This code will generate error
d. This code violates encapsulation
Step by Step Solution
3.44 Rating (160 Votes )
There are 3 Steps involved in it
The detailed answer for the above question is provided below 17 An abstract class is a class that ca... View full answer
Get step-by-step solutions from verified subject matter experts
