> i asked only the two words which i didn't understand
> from the books i read. i have many books but couldn't
> find a good answer. i tried writing to this forum
> hoping someone can answer me.
ok. it's just you're showing all the signs so far of someone who's going to be here for months, asking for an explaination of everything, bit by bit!
the word 'main' is the name of the method - I expect you already know that bit, if so, sorry! - and the typical JVM takes a class name as an argument, and looks for a method that is exactly public, static, void, called 'main' and takes an array of strings as it's only argument. they could have chosen any name they wanted, but chose main as a throwback to 'C' (probably actually a precursor to 'C') in which the main function serves a similar purpose. it's called main because, well, it's the main entry point, the name just makes sense
> i thought this was the section for the people who are
> new to java not for people who are experts!!!!!
yeh, it is. but you don't need to be a java expert to look something up in the documentation, or do a quick search of the internet! questions that the poster could easily find the answer for themselves tend not to get answered here
> what ever!!! i thought forums are good if you need
> any help but i was wrong. and i did not ask you
> something which does not have to do with java either.
what are you on about? I've answered your question!
just when I thought you didn't have the typical newbie chip on your shoulder....
> > what ever!!! i thought forums are good if you need
> > any help but i was wrong. and i did not ask you
> > something which does not have to do with java
> either.
>
> what are you on about? I've answered your question!
>
> just when I thought you didn't have the
> typical newbie chip on your shoulder....
I see more than a chip there; it looks more like a boulder.
Good day Friend!
let me say java is an enhanced version of c and c++
It follows the same syntax & procedure of c and c++
Funtion of main :
this main method is also a function in java. but before we start doing calculations we need to something to initialise . so java developers declared main function to be called first during every execution and to initialise and to call others
Some Funny things:
Some people are saying that the word comes from the river Main in Germany.
because it is also doing the same thing as Main function
with regards
vasu_gb@yahoo.co.in
> in 'public static void main', what does 'main' mean?
Well.
'main' is a Method that java launcher tool uses to start an application.
NOTE: there is slight difference in a java class and java application caused by main method.
class MyClass {
//code here
}
Class YourClass {
//code here
public static void main(String[] args) {
//code here
}
}
MyClass is just a class of java, will be compiled but not run coz did't have main method.
C:\javac MyClass.java // fine
C:\java MyClass // Error
YourClass is not only a class but also a java application that you can run.
C:\javac YourClass.java // fine
C:\java YourClass // fine
Hope its clear to you.