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 8538803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:12:30+00:00 2026-06-11T11:12:30+00:00

Since a static function call is translated into a static invocation bytecode regardless of

  • 0

Since a static function call is translated into a static invocation bytecode regardless of how the definition exists… is there some way to force a caller of a static function to compile successfully even when the target function and class don’t exist yet?

I want to be able to compile calls to functions that don’t exist yet. I need to tell the compiler to trust me that at runtime, I’ll have them properly defined and in the classpath so go ahead and compile it for now.

Is there a way to do this?

  • 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-06-11T11:12:32+00:00Added an answer on June 11, 2026 at 11:12 am

    Reflectively yes, but not via a regular call.

    The call requires an entry in the string pool that includes the method name and parameter types so the compiler needs to be able to decide on a signature for the method.

    invokestatic <method-spec>

    <method-spec> is a method specification. It is a single token made up of three parts: a classname, a methodname and a descriptor. e.g.

     java/lang/System/exit(I)V
    

    is the method called “exit” in the class called “java.lang.System”, and it has the descriptor “(I)V” (i.e. it takes an integer argument and returns no result).

    Consider

    AClass.aStaticMethod(42)
    

    Without knowing anything about AClass, it could be a call to any of

    1. AClass.aStaticMethod(int)
    2. AClass.aStaticMethod(int...)
    3. AClass.aStaticMethod(long)
    4. AClass.aStaticMethod(long...)
    5. ditto for float and double
    6. AClass.aStaticMethod(Integer)
    7. AClass.aStaticMethod(Number)
    8. AClass.aStaticMethod(Comparable<? extends Integer>)
    9. AClass.aStaticMethod(Object)
    10. AClass.aStaticMethod(Serializable)

    and probably a few others that I’ve missed.

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

Sidebar

Related Questions

Since Amazon offers a great way to run static sites off S3. I am
The Window-Procedure in the Win32 API must be static \ global function since it
Since now I have only used plugin for editing and the way I use
I'm trying to call a function within a string return statement. Both are in
I used SWIG for generating some native JNI function interface for Irrlicht C/C++ 3D
I've came into a need of calling a server-side function from a javscript function.
There is a link in my webpage, the link itself triggers a function that
In our web-app we are using Launcher to call some command line functions (not
I have a static function in a class with two overloads. Both the overloads
I have the next function: static bool isPowerOf(int num, int power) { double b

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.