Why the program getting error if we don't use String args[]
in main(), even in the case of not getting any arguments
from command line?
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 ? | 5 Yes | 0 No |
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.
what is runtime class?
write a program that will ask the user to enter a number n and display the product of all numbers from 1 to n.
Write a program to convert a decimal number to binary form?
how to print a message to console without using main() function?(do not use even static blocks also.)
write a program in java to solve a system of n-variabled simultaneous equations using the guassian elimination method. let the maximum possible value of n be 100. run the program using hypothetical values for a set of 10- variables simultaneous equations. print out the program, the input equation and the results generated by the program.
inner join,outerjoin,trigger,stored procedure explain with code snippets?
Why the program getting error if we don't use String args[] in main(), even in the case of not getting any arguments from command line?
In java, why do we set thread priority, when we know that there is no guarantee by which a thread should be execute?
write a program in java to find the moving average of all prime numbers between 2 and 100.
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.
write a program that inputs two real numbers then exchanges their values.