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 restrictions are placed on method overloading?

1130


What is string variable?

996


What do you mean by synchronized non access modifier?

954


What does @param args mean in java?

1022


What is the difference between a factory and abstract factory pattern?

1091


Are constructors methods?

961


What are the advantages of exception handling?

1016


What is return keyword in java?

1014


Can java list contain duplicates?

964


What are the four corner stones of oop?

984


What are the differences between heap and stack memory in java?

1005


How do you input a string in java?

1006


What is an immutable object?

1050


Can a source file contain more than one class declaration?

918


Is string is a data type in java?

993