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 |
Can we declare the static variables and methods in an abstract class?
why are wait(), notify() and notifyall() methods defined in the object class? : Java thread
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?
Name the immediate superclass of the MenuComponent class?
Can we use a default constructor of a class even if an explicit constructor is defined?
Explain about the performance aspects of core java?
What is the right data type to represent a price in java?
What is the purpose of main function in java?
What is the reason behind using constructors and destructors?
How will you convert an ArrayList to Arrays?
What are facelets templates?
How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?