Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Declare main method as private within the Java forums, part of the Software Development category; If we declare the main method as private instead of public it will execute or not...
|
|||||||
|
|||
|
Re: Declare main method as private
hi ,
In run time,jvm checks main method with this convention(public static void main(String args[]) ) if you dont define this method as actually defined, JVM shows run time error as no such method.it wont execute any statement of any other main method. |
|
|||
|
Re: Declare main method as private
Quote:
Making it private would not provide access to JRE. vj |
|
|||
|
Re: Declare main method as private
Dear Rajesh,
The Main Method will not execute if you will declare as private . It should be public . Regards, Jayant |
|
|||
|
Re: Declare main method as private
One can declare the main method as private, but a main method with private access specifier will not be treated by the java runtime, as entry point of the program.
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| java program without main method | BHASKAR CHAUHAN | Java | 6 | 10-31-2008 02:06 PM |
| How to declare Global variables in QTP by using vb script? | Geek_Guest | QTP | 1 | 08-28-2008 12:13 PM |
| How to declare variables in SP? | bharathi_ark | SQL Server | 4 | 10-01-2007 08:38 AM |
| I would like to declare the log variable for class B | archanadadhich | Java | 1 | 08-30-2007 07:21 AM |