Why we r using String args[] in main() even though v r not
passing any arguments in command line?
Answers were Sorted based on User's Feedback
Answer / mehtaashish
First of all an in appropriate main method will not cause any
compile time error, it results in a runtime exception. The
reason for this is that the main method's signature is written
as such in Java specification. And all the interpreters and
compiler and constructed while keeping language specification
in mind. So whenever we try to run a program JVM looks for
"public static void main(String args[])" for starting
execution. And if it does not find any main method, it throws
the "NoClassDefFoundException".
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / abcd
First of all an in appropriate main method will not cause any
compile time error, it results in a runtime exception.
i think reason is ase all know java program can run usingg
the same name as class name."String args[]" takes program
name as first argument that's why it gives run time exception.
| Is This Answer Correct ? | 0 Yes | 6 No |
Write a program to convert a decimal number to binary form?
1+(2*3)+(4*5*6)+(7*8*9*10)+... specified input value
write a java program to create a Frame with three scrolls, change the back ground color of the frame using functions with values of scrolls.
write a c program which takes 20 numbers in an array as input from user and rearrange them in two different array defining even or odd
what is runtime class?
Write a java program to display multiplication table in a Frame.
How to create and run runnable jar file of a Java Project.
4 Answers HCL, TCS, Tech Mahindra, US Consulate, Wipro,
inner join,outerjoin,trigger,stored procedure explain with code snippets?
For printing a message we use System.out.println in normal programs. We use String msg="text....."; Can't we use String msg=" " in normal programs and System.out.println("........") in applets. Please answer this question?
Bubble Sort. java thereafter the user will be asked to inpout the size of the list,sort the list in ascending order and display the sorted list in a horizontal manner???
I am trying to pass the string firstName from a Servlet called SampleServet. I am running this on eclipse and it tells me that "the value for annotation attribute must be a constant expression. I don't understand why it is giving me this error. @PersonAnnotation(name = SampleServlet.firstName) public class AnnotationClass{
Can we run Applet in Web browser with security policy files