they asked class A{}
class B{}
class c{}
all the three class saved as a single file,there is no main
method in the file
and anothe class
M.java
class m
{
psvm(String args[])
{
// here the parent class can access
}
}
Answers were Sorted based on User's Feedback
Answer / suresh
Yes. You can call parent classes ( i.e A or B or C) inside
of class M by instantiate and invoke methods. If parent
classes have static methods you can directly access without
instantiating.
| Is This Answer Correct ? | 1 Yes | 0 No |
If a class is declared without any access modifiers, where may the class be accessed in java programming?
What do you mean by inner class in java?
What are java methods?
What is an Exception ?
How do I print a “?
Can an interface implement another interface?
Which is the best sorting technique in java?
Package1 and Package2 both have a method name lets say "methodA" with different implementation. When I import both the packages in a java class how can I use both the methods?
what invokes a threads run() method? : Java thread
Which sorting algorithm is best in java?
Give the hierarchy of inputstream and outputstream classes.
Can we have multiple classes in single file ?