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?
write a program that inputs two real numbers then exchanges their values.
A game that has five levels of play has the score for each level stored in an array. You are to write a program that goes through that array and finds: a) the minimum score, and the level at which it occurred b) the maximum score, and the level at which it occurred c)the average score for all five levels The score data you must use for this program are as follows: Game Level Score 1 450 2 316 3 148 Stack implementations is mandatory.
In java, why do we set thread priority, when we know that there is no guarantee by which a thread should be execute?
Design a program using one-dimensional array that determines the highest value among the eight input values from a user. Display the difference of each value from the highest to the lowest.
Why we r using String args[] in main() even though v r not passing any arguments in command line?
1+(2*3)+(4*5*6)+(7*8*9*10)+... specified input value
inner join,outerjoin,trigger,stored procedure explain with code snippets?
what are the other loops except for for,while,do while and until?
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
how to store and retrive a set of values without using an array
Is there any static classes are in java give some examples