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 happens when you try to update data in a dataset in .net while the record is already deleted in sql server as backend?

0 Answers  


What is the access level of the visibility type internal?

0 Answers  


How many types of assemblies are there in the visual studio.net?

1 Answers   Six Sigma,


What is the use of CLR in .NET?

0 Answers   HCL,


what is the difference between Exportdll and Importdll ?

1 Answers  


What is an interrupt? : Dot net architecture

0 Answers  


What is IL code, CLR, CTS, GAC & GC?

0 Answers   MindCracker,


How many types of languages does .net support? name at least 10-15?

12 Answers   Interac, Six Sigma, TechUnity,


What are the different access modifier? Explain in detail?

2 Answers   Tesco,


Explain about httpruntime.cach.get(); method?

0 Answers   Tech Mahindra,


how to use custom field validation

0 Answers   PCS, Prithvi,


Can you explain server controls in atlas?

0 Answers  


Categories