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 a “stateless” protocol ?
What is boolean flag in java?
what is bmg file and how to create that files?what will it contailn?
What is meant by distributed application? Why are we using that in our application?
Can private class be inherited in java?
If try block is successfully executed, Then Is Finally block executed?
What is method overloading with type promotion?
Can I declare a class as private?
Can you write a java class that could be used both as an applet as well as an application?
What is java in simple terms?
How can we break singleton in java?
What is the difference between hashmap and hashtable? What is an interface?
What are the differences between heap and stack memory in java?
What is public/private protected in java?
How does arraylist work in java?