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


Please Help Members By Posting Answers For Below Questions

Can I overload to string method

968


What is a values collection view ?

685


Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?

617


What is the purpose of the finalize() method?

713


Is age discrete or continuous?

688






How do you use find and replace?

511


What is the difference between Grid and Gridbaglayout?

584


Describe how to implement singleton design pattern in struts.

535


describe synchronization in respect to multithreading? : Java thread

505


What do you mean by scope of variable?

488


What are peerless components in java programming?

585


Can we use a default constructor of a class even if an explicit constructor is defined?

655


Can we overload the methods by making them static?

506


What is the purpose of main function in java?

539


What is boolean false?

531