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...


write a simple program inheritance?

Answers were Sorted based on User's Feedback



write a simple program inheritance?..

Answer / prashant khot

class A
{

}
class B extends A
{
public static void main(String args[])
{
B b = new B();

}
}
In the above example, B is the class extending the A class.
Means that B is inherited from A.

Is This Answer Correct ?    26 Yes 2 No

write a simple program inheritance?..

Answer / dhawal

class A
{
int a=10;
}
class B extend A
{
public static void main(String[] a)
{
B objB;
objB=new A();
System.out.println("Value of a is"+objB.a);
}
}

Is This Answer Correct ?    2 Yes 13 No

Post New Answer

More Core Java Interview Questions

Which one will take more memory: an int or integer?

0 Answers  


Explain in detail about encapsulation with an example?

4 Answers  


Explain what are final variable in java?

0 Answers  


Can we override private methods?

0 Answers  


Can an abstract class be final?

10 Answers  


Why is stringbuffer called mutable?

0 Answers  


What is static variable with example?

0 Answers  


Difference between notify() method and notifyall() method in java?

0 Answers  


question on Thread synchronization

3 Answers   Huawei,


What language is an assembler written in?

0 Answers  


What is the difference between hashmap and hashtable in java?

0 Answers  


Difference between error and exception

3 Answers   Nous, TCS,


Categories