Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?



Why the program getting error if we don't use String args[] in main(), even in the case of not..

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

Post New Answer

More J2SE Code Interview Questions

1+(2*3)+(4*5*6)+(7*8*9*10)+... specified input value

1 Answers   MAQ,


how to print a message to console without using main() function?(do not use even static blocks also.)

14 Answers   Google, Zoho,


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.

0 Answers  


Write a java program to display multiplication table in a Frame.

1 Answers  


Write a program to convert a decimal number to binary form?

1 Answers   Oracle,


Is there any static classes are in java give some examples

0 Answers  


does anyone know the code to display a triangle using a applet?

1 Answers  


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???

0 Answers  


inner join,outerjoin,trigger,stored procedure explain with code snippets?

1 Answers   IBM,


write a program in java to find the moving average of all prime numbers between 2 and 100.

0 Answers  


Why we r using String args[] in main() even though v r not passing any arguments in command line?

2 Answers  


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?

1 Answers  


Categories