Is there any need to import java.lang package?

Answers were Sorted based on User's Feedback



Is there any need to import java.lang package?..

Answer / venkataanjaneyulu.sudireddy

Cloneable
Runnable

Is This Answer Correct ?    0 Yes 1 No

Is there any need to import java.lang package?..

Answer / 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

Is there any need to import java.lang package?..

Answer / rakesh

navneet can u justify your ans with example plzzzz.

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More Core Java Interview Questions

Is it possible to use string in the switch case?

0 Answers  


What is the argument type of main() method?

2 Answers  


Why do we use threads in java?

0 Answers  


What is the technique adopted to create an immutable class?

0 Answers  


What is a static method in java?

0 Answers  






What is the difference between a public and a non-public class?

2 Answers  


Write a factorial program using recursion in java?

0 Answers  


Is multiple inheritance allowed in Java? Why ?

7 Answers  


How the elements are organized in BorderLayout?

5 Answers  


How does sublist works in java?

0 Answers  


1.) if we use "private" in place of "public" in public static void main()... 2.) if we use "int" in place of "void".... 3.) can we ommit "static" keyword from that statement.... 4.) also can we give the command line arguments type as int type or float,etc.(.i.e (string args[]))

1 Answers  


What are conditionals and its types?

0 Answers  


Categories