write a simple program inheritance?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the final variable?

584


What is multithreading and its advantages?

579


What is stored procedure. How do you create stored procedure ?

1502


What do you understand by garbage collection in Java? Can it be forced to run?

558


What is logical variable?

520






Can static methods be inherited?

537


What are the main concepts of oops in java?

599


How do you invoke a method?

545


What is the differences between heap and stack memory in java? Explain

537


Explain throw keyword in java?

618


What is subsequence of a string?

609


What is a super method?

534


How many decimal places is a double?

543


If two threads have same priority which thread will be executed first ?

849


Can you tell me range of byte?

566