In Java why we write public static void main(String args[])
why not main()?
Answer Posted / srinivas_cena
public- public isa access specifier,so we can use the method from out the class
static- static is a keyword which is used to calla methos with out creation of object for a class. so jvm directly runs from main() method.
void- main() method does not return any value so it has void data type.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can we increase array size dynamically in java?
What all methods are used to prevent thread execution ?
Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?
Is overriding possible in java?
What is numeric function?
Which one will take more memory: an int or integer?
How many tetrahedral voids are there in bcc?
How does class forname work in java?
What is the purpose of the runtime class in java programming?
Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.
Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls
Can we cast any other type to boolean type with type casting?
How do you use parseint in java?
What are the 2 types of java programs?
Can we access the non-final local variable, inside the local inner class?