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 are passing parameters?

1068


Why javac is not recognized?

921


When will you define a method as static in Java?

1035


Write a function to print Fibonacci series and Tribonacci series?

1164


Why do people says “java is robust”?

1012


What is the replace tool?

1135


What is args length in java?

1155


Explain the concept of proper inheritance?

1052


Can extern variables be initialized?

932


How many characters is 2 bytes?

975


What is math exp in java?

1034


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

1043


What is the purpose of using break in each case of switch statement?

1003


I want to store more than 10 objects in a remote server? Which methodology will follow?

3178


What about anonymous inner classes in java?

1012