Forum Stats

  • 3,826,763 Users
  • 2,260,705 Discussions
  • 7,897,072 Comments

Discussions

Prevention of interpretation of interfaces

3425916
3425916 Member Posts: 1
edited Apr 4, 2017 2:09AM in Java Programming

How can you prevent interfaces from being Interpreted in java

interface A{ int x;

double addPrice(double a,double b);

}

how to stop interface A from being Interpreted

Answers

  • Unknown
    edited Apr 3, 2017 12:03PM
    How can you prevent interfaces from being Interpreted in javainterface A{ int x;double addPrice(double a,double b);}how to stop interface A from being Interpreted

    The only way I know is: DON'T USE IT.

    Don't implement it in classes and don't include it in the classpath when you compile.

    Other than that why would you have it to begin with if you don't want it to be used?

    WHAT PROBLEM are you trying to solve?

  • jwenting
    jwenting Member Posts: 4,864 Gold Badge
    edited Apr 4, 2017 2:09AM

    What do you even mean by "interpreted"?

    I guess you're talking about decompilers? There's only one way and that's never to distribute your compiled classes.

    And why'd you want people to not be able to decompile your interfaces anyway? It makes no sense, there's nothing in there that'd in any way be helpful beyond what decent documentation already provides (or shouldn't be, I know some people put method implementations in interfaces now).

This discussion has been closed.