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 to sort array of 0 and 1 in java?
What is difference between path and classpath in java?
What is size of int in java?
What is javac_g?
What is encapsulation in java?
What is the synonym of string?
Difference between static synchronization vs. Instance synchronization?
How is string immutable in java?
Explain the significance of listiterator.
For class CFoo { }; what default methods will the compiler generate for you>?
Which class is the superclass for all the classes?
What is a treemap in java?
What is the meaning of 3 dots in java?
What things should be kept in mind while creating your own exceptions in java?
Explain about main thread in java?