2. I've a class Parent Class A and a Derived Class B. Here
is a scenario.
I've an instance of Class A as objA and an instance of Class
B as objB.

I can refer a child class variable as objB=objA, but
cannot do objA=objB what is the reason?



Answers were Sorted based on User's Feedback



2. I've a class Parent Class A and a Derived Class B. Here is a scenario. I've an instan..

Answer / gopal

Here ObjA is Base Class and ObjB is Derived Class.
In Inheritence Process Derived class Will get the all
features of Base Class.
because objB=O=objA Is COrrect

Is This Answer Correct ?    2 Yes 0 No

2. I've a class Parent Class A and a Derived Class B. Here is a scenario. I've an instan..

Answer / ashok

Is this you are trying to do?

class A
{
public int MyName { get; set; }
}

class B : A
{
public int MyName1 { get; set; }
}

public class TestAB
{
public static void Test()
{
A objA = new A();
B objB = new B();



objB = (B)objA; // Unable to cast object of type
'AdvanceLib.A' to type 'AdvanceLib.B'.
objA = objB;

}

}

---

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net AllOther Interview Questions

what is the difference between Exportdll and Importdll ?

1 Answers  


What is boxing and unboxing? Does it occure automaatically or you need to write code to box and unbox?

0 Answers  


Hi i need fast track course maximum to complete within a month....courses are Asp.net,c3,vb.net n sql server........at hyderbad location ..best institute n cost

1 Answers   Chevron,


What is the application frame host?

0 Answers  


Does application frame need host?

0 Answers  






Explain how to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile

0 Answers  


What is the access level of the visibility type internal?

0 Answers  


What is password attribute of the textbox control of .net mobile? : Microsoft dot net mobile

0 Answers  


which of the following statement is true about gac. a)it is being handled by .net framwork b)It is special folder c)it can have files with same name etc etc.

4 Answers   Honeywell,


how do create a repeater

3 Answers  


What is the difference between custom controls and master page?

1 Answers   Tesco,


Explain about the base class library provided by microsoft.net?

0 Answers  


Categories