Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 asp and asp.net

1 Answers   Six Sigma,


what is ado.net

8 Answers   BirlaSoft, HCL,


Explain dma? : Dot net architecture

0 Answers  


What is Video Streaming in .net??

0 Answers   Infosys,


What is .net mobile lists. : Microsoft dot net mobile

0 Answers  


what is the method while we are using adapter and dataset ?

0 Answers  


Which tool you will use to deploy a windows service

1 Answers   Fulcrum Logic,


Explain .net mobile selectionlist control? : Microsoft dot net mobile

0 Answers  


how can we achieve language interoperability through CLS? How MSIL works?

0 Answers   EDS,


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

0 Answers  


what is the difference between value types and reference types?

4 Answers   Six Sigma,


Write a query Where,Groupby,having clauses?

2 Answers   iGate,


Categories