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

What is an inner class in java?

0 Answers  


What are non-access modifiers?

2 Answers   Cognizant,


What is a flag value?

0 Answers  


Which package has light weight components in java programming?

0 Answers  


What do you mean by light weight and heavy weight components?

0 Answers  


why the abstract class has default constructor?

2 Answers  


Explain about main() method in java ?

0 Answers  


why java does not contain pointers?

13 Answers   Infosys, TCS,


How to create a thread in java?

0 Answers  


Why collection doesn’t extend cloneable and serializable interfaces?

0 Answers  


What is port number in java?

0 Answers  


What is the difference between a local variable and an instance variable?

0 Answers  


Categories