Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 677507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:02:49+00:00 2026-05-14T01:02:49+00:00

As we all know Java program will start executing from the public static void

  • 0

As we all know Java program will start executing from the public static void main(String[] args) method of the class.

So was curious to know that is there any other way by which we can make another static method as the entry point, that is can we override this property of the JVM to start with some other method than main?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:02:49+00:00Added an answer on May 14, 2026 at 1:02 am

    AFAIK the JVM always starts with the main method. The only official reference I was able to find is in section 12.1.4 of the java language specifications, which states:

    12.1.4 Invoke Test.main

    Finally, after completion of the initialization for
    class Test (during which other
    consequential loading, linking, and
    initializing may have occurred), the
    method main of Test is invoked.

    The method main must be declared
    public, static, and void. It must
    accept a single argument that is an
    array of strings.

    That doesn’t seem like an awful restriction to me, though. You could technically write a “MainSelector” class whose main() takes the fully qualified name of a class and method as a command line argument, and uses reflection to invoke that method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import java.util.Collection; public class Test { public static void main(String[] args) { Collection c
We all know of sleep method available in java threads.. I understand that the
I know that Java enforce the programmer to list all exceptions that will be
As you maybe know, as Java language perspective all method in C# are final
As we all know, String is immutable in java. however, one can change it
As we all know java allows us to use byte array as a buffer
I have a background of programming in Java and C++, so I know all
I know that in java that we use *(asterisk) to import all the contents
As you know, in a java interface, all methods have to be defined as
We all know that openId has become such a popular method for user authentication,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.