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
What is an empty string in css?
What restrictions are placed on method overloading in java programming?
What is the purpose of the main method?
Explain the difference between throw and throws in java?
What is an enumeration?
Is string passed by reference in java?
What is the benefit of using enum to declare a constant?
What is main method?
Explain about anonymous inner classes ?
What is boolean strategy?
Can an interface be defined inside a class?
Does java isempty check for null?
What is the basic difference between string and stringbuffer object?
How many types of design patterns are there?
What are the differences between heap and stack memory in java?