public for visible to compiler/interpreter.
static only one main for one class/file/package.
void return none to compile/interpreter.
Thank you,
Sid.



On Mon, Oct 3, 2011 at 1:35 PM, Vengadanathan <fantastic.n...@gmail.com> wrote:
> Hello everyone , i recently attended a mock interview kept by one of
> my alumni , i was asked the following questions ,
> Question asked : What language JVM is written ?
> I answerd : In c ...
>
> correct then
>
> Question asked : why java main function is declared as public static void
> main() ?
> I answerd :
> main() can be accessed by other classes so it is declared public , and
> by declaring static the jvm can call the main function directly by
> classname.main(..) without creating a object ..
> But they asked me in turn ,
> Why would main function called and used by other classes ?
> JVM is written is c , why does then it call classname.main() (oops is not
> supported in c) while executing a java program instead it can directly
> traverse through the byte code and execute the main function
>
> I answerd  : ????????
> can any one please give explanation / answer for the questions they asked
> ... thanx in advance .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/a9PWhQjSnvcJ.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to