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 |
Is void a wrapper class?
How to eliminate duplicates from an array?
6 Answers ABC, AdMod, Adobe, College School Exams Tests, Patni, Wipro,
Does a function need a return?
Discuss about garbage collector in Java.
0 Answers Agilent, Integreon, ZS Associates,
What are the differences between stringbuffer and stringbuilder?
What is local declaration?
What are the methods used to implement for the key object in the hash map?
Explain abstract class in java?
Is it possible for a yielded thread to get chance for its execution again?
What is the difference between variable declaration and variable initialization?
how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion
What is jagged array in java?