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

Can main() method in java can return any data?

1236


How do we access static members in java?

1156


What are the differences between the constructors and methods?

1177


What is a byte array?

1148


Is intellij better than eclipse?

1142


What is meant by 'bit masking' in java?

1255


Is there a sort function in java?

1012


What does it mean that a method or field is “static”?

1022


What is consumer in java?

1010


What is the difference between the direct buffer and non-direct buffer in java?

1077


What are different types of control structures?

1030


Which is dependent variable?

950


What is incompatible types in java?

1083


which class is the wait() method defined in? : Java thread

989


What does a void function return?

1059