ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Code Snippets >> Programming Code >> Java Code >> J2SE Code
 
 


 

 
 J2SE Code interview questions  J2SE Code Interview Questions (32)
 J2EE Code interview questions  J2EE Code Interview Questions (20)
 J2ME Code interview questions  J2ME Code Interview Questions (5)
Question
is public static void main() work in java?is "String arg[]"
needed as argument?
 Question Submitted By :: J2SE-Code
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
public static void main() will not work in java.
You have to give argument String arg[]
 
Is This Answer Correct ?    12 Yes 0 No
Kapil
 
Answer
# 2
Without specifying "String[] args" it will be compiled...
but will create run time exceptoin...
 
Is This Answer Correct ?    5 Yes 1 No
Ghanshyam Dobariya
 
 
 
Answer
# 3
as overloading is also done implicitly in java...without
writing the whole signature of the function main ..java will
compile it as a user-defined function rather than the main
function it is looking for.

so we have to write the whole signature
public static void main(String[] args)
 
Is This Answer Correct ?    2 Yes 0 No
Abhishek Goray
 
Answer
# 4
each and every main method of java program must take array of objects of string class.Hence writing String args[] as main method arguement is must. 
Is This Answer Correct ?    1 Yes 0 No
Sravani
 

 
 
 
Other J2SE Code Interview Questions
 
  Question Asked @ Answers
 
inner join,outerjoin,trigger,stored procedure explain with code snippets? IBM 1
is public static void main() work in java?is "String arg[]" needed as argument? Tech-Mahindra 4
Write a program to convert a decimal number to binary form? Oracle 1
write a program that inputs two real numbers then exchanges their values. Infosys 7
how to print a message to console without using main() function?(do not use even static blocks also.) Google 9
How to create and run runnable jar file of a Java Project. HCL 4
Why we r using String args[] in main() even though v r not passing any arguments in command line?   2
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
how to store and retrive a set of values without using an array Maximus 8
Write a java program to display multiplication table in a Frame.   1
how to create a (*)pyramid using java codes??? Infosys 5
does anyone know the code to display a triangle using a applet?   1
 
For more J2SE Code Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com