Is there any need to import java.lang package?
Answer Posted / navneet raushan
Hi Rakesh .. I m writing the code
import java.lang.reflect.*;
public class DumpMethods {
public static void main(String args[])
{
try {
Class c = Class.forName(args[0]);
Method m[] = c.getDeclaredMethods();
for (int i = 0; i < m.length; i++)
System.out.println(m[i].toString());
}
catch (Throwable e) {
System.err.println(e);
}
}
}
| Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
How do you get length in java?
what is meant wrapper classes?
What is static and final keyword in java?
Why call by value prevents parameter value change?
What is continuity of a function?
What is java used for?
What is queue in java?
How to print an arraylist in java?
Why is a string immutable?
What is dynamic binding(late binding)?
What is a java applet? What is an interface?
Why is singleton not thread safe?
Can a source file contain more than one class declaration?
what is the volatile modifier for? : Java thread
Explain the advantages of packages in java?