View Count: 0
Duration: 25 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 25 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 15 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Question No: 1 of 17
Which of the following are true about Interface? 
Options:
  1. An interface can have methods
  2. An interface can have properties
  3. An interface can have constructor
  4. An interface can have fields
View Answer/Explanation:
a b
Explanation:
Interface cannot have fields, constructor & destructor

Question No: 2 of 17
Every member of an interface is by default? 
Options:
  1. public
  2. private
  3. protected
  4. abstract
View Answer/Explanation:
a d
Explanation:
public, because only then they will be available for users to access abstract because they have to be compulsory implemented by class implementing the interface.

Question No: 3 of 17
interface IA
{}
class CA:IA
{}
a. IA a1=new IA();
b. IA a2=new CA();

Which of the above two statements are valid? 
Options:
  1. a & b
  2. Only a
  3. Only b
  4. None of the above
View Answer/Explanation:
c
Explanation:
Interface cannot be instantiated A reference variable of type interface can refer to an object of a class which implements that interface.

Question No: 4 of 17
What is the relation between interface and class? 
Options:
  1. Class inherits all functionality from interface
  2. Class implements all methods of interface
  3. Class contains all members of interface
  4. Class aggregates all members of interface
View Answer/Explanation:
b
Explanation:
Class has to provide implementation for all members of an interface.

Question No: 5 of 17
Which of the following can implement an interface? 
Options:
  1. Another interface
  2. Class
  3. Enum
  4. Structure
View Answer/Explanation:
b d
Explanation:
class and structure both can implement interface interface can inherit but on implement an other interface

Question No: 6 of 17
Which of the following can be member of interface? 
Options:
  1. Static field members
  2. Static properties
  3. Static methods
  4. Static constructors
  5. None of the above
View Answer/Explanation:
e
Explanation:
Static members are not allowed in interface.

Question No: 7 of 17
What is the o/p of this program? 

interface IA1
{
	void Foo();
}
class CA:IA1,IA2
{
	private void Foo1()
        {
                Console.WriteLine("In Foo1");
        }
        static void main()
        {
                IA1 a =new CA();
                a.Foo();
        } 
} 
Options:
  1. In Foo1
  2. Compilation Error
  3. Runtime Error
  4. Nothing and just blank
View Answer/Explanation:
b
Explanation:
Interface member when implemented in class cannot be declared as private.

Question No: 8 of 17
What is the o/p of following members:
interface IA1
{
	void Foo();
}
class CA:IA1
{
	private void Foo1()
        {
        	Console.WriteLine("In Foo1");	
	}
        private void Foo2()
        {
        	Foo1();
                Console.WriteLine("In Foo2");	
	}
        static void Main()
        {
        	IA1 a =new CA();
                a.Foo2();
	}
} 
Options:
  1. In Foo1 In Foo2
  2. In Foo2 In Foo1
  3. Compilation Error
  4. In Foo1
  5. In Foo2
View Answer/Explanation:
c
Explanation:
CA implements IA1 but doesnt implement Foo method of the interface

Question No: 9 of 17
interface IA1
{
	void Foo1();
}
class CA:IA1
{
	_______ void Foo1()
        {
                Console.WriteLine("In Foo1");
        }    
}
What could be the value in the blank 
Options:
  1. public
  2. private
  3. abstract
  4. blank (nothing)
View Answer/Explanation:
a
Explanation:
Implementation of interface must be public

Question No: 10 of 17
interface IA1
{
	void Foo1();
}
class CA:IA1
{
	_______ void IA1.Foo1()
        {
                Console.WriteLine("In Foo1");
        }    
}
What could be the value in the blank 
Options:
  1. public
  2. private
  3. abstract
  4. blank (nothing)
View Answer/Explanation:
d
Explanation:
Explicit implementation cannot be public or private

  1