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 |
what is runtime class?
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?
Can we run Applet in Web browser with security policy files
1+(2*3)+(4*5*6)+(7*8*9*10)+... specified input value
Write a java program to display multiplication table in a Frame.
how to print a message to console without using main() function?(do not use even static blocks also.)
write a program that will ask the user to enter a number n and display the product of all numbers from 1 to n.
Is it possible to define marker interface in java.If possible then how to define user defined marker interface?
we compile any program bu c:/>javac prog.java and run as c:/>java prog Here what's the meaning of c in javac. We have java Interpreter but not compiler.Then why we have to use javac. Please answer this question?
How to create Date method to set the date in Ms Access
How Can I Trace A Java Program . Please Give Me Step by Step Process
Why we r using String args[] in main() even though v r not passing any arguments in command line?