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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:07:12+00:00 2026-05-25T19:07:12+00:00

I just encounter a real problem about changed API. And i want to know

  • 0

I just encounter a real problem about changed API. And i want to know more about this topic.
Using the following example as a demo.

There are 4 simple classes, Child class extends Parent. PubAPI is the class which provides public method for cient use. Client class invokes PubAPI’s public methods.

public class Parent
{
}

public class Child extends Parent
{
}


public class PubAPI
{
public Parent getChild(){
    return new Child();
}
}


public class Client
{
public static void main(String[] args)
{
    System.out.println(new PubAPI().getChild());
}
}

The first 3 class is provided by an API maker, let’s say the above version is version 1.

in Version 2, the PubAPI class is changed to return child type :

public class PubAPI
{
public Child getChild(){
    return new Child();
}
}

the 3 API provider class is in versoin 2 now, while if we don’t recompile the “Client” class and use its version 1 generated class file. IT will fail in java runtime with error can not find the version 1 method (because the return type changes).

I don’t know this before, and i want to know if anyone know more about this topic , for example, if the public API add a throw, or addd a synchronize or the class become final, etc. In these situation, how will it hehave.

IN all, what is the public API/class bytecode level compabability rule for API classes used by others.

thanks.

  • 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-25T19:07:13+00:00Added an answer on May 25, 2026 at 7:07 pm

    EDIT: You asked almost the exact same question two weeks back and accepted an answer. I am wondering what prompted you to ask again, you didn’t think the rules would have changed in two weeks, did you?

    You are on the right track with the keyword bytecode level compatibility. It is called binary compatibility which you can look up on the net. For example, here

    The rules are not always easy to understand at first but usually make sense when you get an error and think about them. Best thing is to try the individual cases you have listed and when you get an error confirm in JLS that is an incompatibility and then try and rationalize for yourself why it is so.

    This question on so seems to discuss the exact same issue. The document at eclipse it sites is an easier read than JLS.

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

Sidebar

Related Questions

I am at a real loss at this problem. I just created a plug-in,
I just encounter a problem similar to http://www.ruby-forum.com/topic/216433 I need to access controller instance
I just encounter a strange problem: var a:ClassA = new ClassA; var b:ClassA =
I just run into the weirdest thing I've ever encounter. Consider this test page:
Hi I am a C++ beginner just encountered a problem I don't know how
I've just started using HTTParty, and i've encountered a problem in the way it
I've just started to work with MPFR arbitrary precision library and quite soon encounter
I just encountered this article of an extention of css sprites that enables the
I've just encountered a weird problem, I'm trying to printf an integer variable, but
I just recently read about Mocking objects for unit testing and currently I'm having

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.