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 java beans?

0 Answers  


what is the difference between static class and singleton class? can we create static class?

2 Answers   L&T, Octazen, Vamsi Labs,


What is an infinite loop? How infinite loop is declared?

0 Answers  


What is an inner class in java?

0 Answers  


Can we access private data outside of the class directly in java programming language? Why There is no runtime checking in java, which leads to access the private data directly outside of a class?

5 Answers   Google,


In Java, what’s the purpose of static methods and static variables?

2 Answers  


Explain about collection interface in java?

0 Answers  


Why deletion in linkedlist is fast than arraylist?

0 Answers  


Can you have a constructor in abstract class?

18 Answers   HCL,


What is null in java?

0 Answers  


Explain some best practices you would apply while using collection in java?

0 Answers  


What is the purpose of the wait(), notify(), and notifyall() methods in java programming?

0 Answers  


Categories