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 interface in java?
What are the three parts of a lambda expression?
What is the exception hierarchy in java?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
Why array is used in java?
How to find the given number is a prime number or not by getting input from the user
What do you mean by byte code?
What does the append?
Give the difference between the println method and sqrt method?
Can a static class have a constructor java?
What is basic syntax?
What are predicates in java 8?
What is bufferedwriter?
What is a functional interface?
Is an integer an object?