Skip to content

Instantly share code, notes, and snippets.

@rozer007
Created November 24, 2021 05:51
Show Gist options
  • Save rozer007/2f0a8bd8fbbd48bc45cdc83865c536f5 to your computer and use it in GitHub Desktop.
Save rozer007/2f0a8bd8fbbd48bc45cdc83865c536f5 to your computer and use it in GitHub Desktop.
ABSTRACT CLASS ,INTERFACE AND OPERATOR OVERLOADING IN C#
Q1 What type of method is define in interface?
ans: Only abstact method can be define in an interface.
Q2 Can we write the body of the function in simple method in abstract class.
ans : yes we can write the body of the simlpe method but we cannot write for the abstract method.
Q3.What type of polymorphism is operator overloading?
ans:It is a compile time polymorphism.
Q4 what keyword is use to access the abstract method from the abstract class?
ans: For declaring the method and write the body we use override keyword.
For calling the method we use invoke keyword.
Q1 what keyword is use to implements abstract class?
a. base()
b. hide
c. abstract
d. none the above
ans c
Q2 can we create a simple function in abstract class?
a.true
b.false
ans a -true
Q3 we can store simple method in interface?
a.true
b.false
ans: b
Q4 What is correct syntax for operator overloading:
a. access specifier class_name operator(arg1..)
b. access specifier class_name operator operator_symbol(arg1..)
c. access specifier class_name operator = operator_symbol(arg1..)
d. none of the above
ans b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment