4

Click here to load reader

Public static void main in Java

Embed Size (px)

DESCRIPTION

"Would you please explain all parts of public static void main?" is the common question in interviews and viva. You would find millions of pages on this question. Still it is students nightmare while facing this question related with Java language. One needs to have deep understanding of many topics like working knowledge of C and C++ programming language and thorough understanding of Procedure Oriented Programming as well as Object Oriented Programming. Besides student needs to know about many intricacies like command line arguments, array of strings, array of pointers to strings, access category in object oriented programming methodology, philosophy behind class and object concept in object oriented programming with C++, meaning of static and non static data and member function, function calling mechanism, return type of function, operating system fundamentals etc. Compilation of all these concepts would let student to answer this question confidently.... If you are not aware of some or all these concepts then you would be just answer objectively and Interviewer would understand that you don't know beyond definition...!

Citation preview

Page 1: Public static void main in Java

literature public static void main God Method

… च

method application करत तर

…!

http://cmarathi.wordpress.com/2013/10/14/command-line-arguments-in-c/

public static void main Java language ओळख . मग

C/C++ language ,

. व

…!

तर व C, C++, Procedure Oriented

Programming, Object Oriented Programming …!

ओळख तर “public static void main ..?” तर

… तर

(Core Java … Servlet, MIDlet )

ण public static void main(String[ ] args) . public

static modifier तर void . main C C++

…!

public static void main pair of opening व closing brackets व .

Single Entry Point ओळख main function तर C C++

. starting point of program execution

.

C C++ Microsoft C#, Visual Basic Google Go, Python

programming language D, Pike, Haskell, Lisp न

main function .

Page 2: Public static void main in Java

C C++ आपण व आत व इतर आत

. उलट आपण

आत . C++ (Fully Object

Oriented Programming) .

C++ / access

मदत व . व

आपण . पण

object oriented programming

methodology static data व static member .

. execute

… व interpreter

… Java Virtual Machine

public static void main …!

main method क तर अडचण …? तर JVM

(object) . JVM .

तर अडचण over load

JVM … भर JVM

…!

reference व

. पण व JVM घर- JVM .

JVM व execute …

. … तर /

. तर आपण .

, .

execution शकत access specifier .

Page 3: Public static void main in Java

C व C++ void return type . करत

सरळ-सरळ (rule) syntax C C++

int void .

. .

व व convention

execute गरज

. ट

.

C, C++ single threading . program entry व

exit point . पण Java multi thread . single thread

JVM (Java Virtual Machine) threads व :

exit code .

: इतर ….!

array of strings argument व Java String (string ) - .

रन interpreter आपण arguments

pointers array . public static void main(String[ ] args)

signature .

argument args . तर args

. . array of pointers to string

.

( तर ) व

पण void तर

.

signature . signature एक

ओळख पण signature …

1. public static void main(String[ ] argument)

Page 4: Public static void main in Java

2. public static void main(String argument[ ])

3. public static void main(String... args)

4. public static synchronized void main(String... args)

5. public static strictfp void main(String... args)

6. public static final void main(String... args)

Note:

Best piece of advice I got when learning to program, and which I pass along to you, is don't worry

about the little details you don't understand right away. Get a broad overview of the fundamentals,

then go back and worry about the details. The reason is that you have to use some things (like

public static void) in your first programs which can't really be explained well without teaching you

about a bunch of other stuff first. So, for the moment, just accept that that's the way it's done, and

move on. You will understand them shortly…. Quote by wellknown programmer