In Java why we write public static void main(String args[])
why not main()?
Answer Posted / prasu
public means this method is called from out side of the
class, means we create the object out side of the class that
situation method is available to object.
viod means return type of the method is nothing.the caller
of main() i.e jvm can not recive any thing from called main().
Static means when ever the class is loaded into memory first
static block is executed so,first jvm calls main().
string args[] is an array,it will receive string type of
arguments.
why we write only that type of specification is because jvm
knows only that type of specificatroin.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Does it matter in what order catch statements for filenotfoundexception and ioexception are written?
What do you understand by abstract classes?
Explain the differences between static and dynamic variables?
What is mnemonic code?
Can arraylist contain null values?
What is the use of pattern in java?
What is meant by object oriented programming – oop?
How do you compare arrays in java?
Write a java program to count the number of words present in a string?
What are the supported platforms by java programming language?
What things should be kept in mind while creating your own exceptions in java?
How do you make a thread in java?
What if I write static public void instead of public static void in java?
Explain wait() method of object class ?
What is mean by collections in java?