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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of a default constructor?

1089


Explain the differences between static and dynamic variables?

1138


If an application has multiple classes in it, is it okay to have a main method in more than one class?

1004


When should the method invokelater() be used?

1012


Is there a case when finally will not execute?

1007


If we don’t want some of the fields not to serialize how to do that?

1006


What are the basic interfaces of java collections framework?

1105


What is the function of character?

1045


Does google use java?

946


Write a program in java to create a doubly linked list containing n nodes.

947


Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?

965


What is singleton class in ruby?

1002


What is sleep method?

1140


What is appletviewer?

1027


Should database connections be singleton?

954