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 nan in java?
what is aggregation in java?
Difference between stack and queue?
Explain about narrowing conversion in java?
What is method Overriding in the perspective of OOPS?
Can you explain the private protected field modifier?
difference throws and throw in java
What class allows you to read objects directly from a stream in java programming?
what is the swingutilities.invokelater(runnable) method for? : Java thread
How many types of string data types are there?
What does microservices mean?
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?