write a simple program inheritance?
Answers were Sorted based on User's Feedback
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 |
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 |
What is use of super keyword in java?
What is the finalize method do?
What is a default package ?
What is the escape character in java?
Tell some latest versions in JAVA related areas?
what is the messsage u r going to get from an objectoriented programing?
What is the purpose of the File class?
What is stack example?
What is indexof?
Why char array is preferred over string for storing password?
what are the application of compiler and interpreter for source program
What are other modifiers?