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

Can we declare the static variables and methods in an abstract class?

0 Answers  


why are wait(), notify() and notifyall() methods defined in the object class? : Java thread

0 Answers  


I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?

0 Answers  


Name the immediate superclass of the MenuComponent class?

1 Answers  


Can we use a default constructor of a class even if an explicit constructor is defined?

0 Answers  


Explain about the performance aspects of core java?

0 Answers  


What is the right data type to represent a price in java?

0 Answers  


What is the purpose of main function in java?

0 Answers  


What is the reason behind using constructors and destructors?

0 Answers   HCL,


How will you convert an ArrayList to Arrays?

4 Answers   KPIT,


What are facelets templates?

0 Answers  


How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

0 Answers   Global Logic,


Categories