Answer Posted / 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 |
Post New Answer View All Answers
What is the purpose of a default constructor?
Explain the differences between static and dynamic variables?
If an application has multiple classes in it, is it okay to have a main method in more than one class?
When should the method invokelater() be used?
Is there a case when finally will not execute?
If we don’t want some of the fields not to serialize how to do that?
What are the basic interfaces of java collections framework?
What is the function of character?
Does google use java?
Write a program in java to create a doubly linked list containing n nodes.
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What is singleton class in ruby?
What is sleep method?
What is appletviewer?
Should database connections be singleton?