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 |
How do you square a number in java?
What is ph and buffers?
What is java and why do we need it? Explain
Explain notify() method of object class ?
What is protected and friendly?
What is enhanced loop in java?
What is final access modifier in java?
Can java object be locked down for exclusive use by a given thread?
What is the use of arraylist in java?
What is string length in java?
what is the Use of throws exception?
What data structures are used to perform recursion?
0 Answers Akamai Technologies,