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

What is an empty string in css?

779


What restrictions are placed on method overloading in java programming?

791


What is the purpose of the main method?

763


Explain the difference between throw and throws in java?

787


What is an enumeration?

789


Is string passed by reference in java?

776


What is the benefit of using enum to declare a constant?

883


What is main method?

789


Explain about anonymous inner classes ?

829


What is boolean strategy?

893


Can an interface be defined inside a class?

781


Does java isempty check for null?

791


What is the basic difference between string and stringbuffer object?

849


How many types of design patterns are there?

807


What are the differences between heap and stack memory in java?

791