I was going through Integer class code and noticed MIN_VALUE and MAX_VALUE are annotated with @native. My question is
What is the purpose of using @native annotation?
Where can we find native code which is used by @native?
Is there any use case where we should use @native annotation in normal programming?
public final class Integer extends Number implements Comparable<Integer> { /** * A constant holding the minimum value an {@code int} can * have, -2<sup>31</sup>. */ @Native public static final int MIN_VALUE = 0x80000000; /** * A constant holding the maximum value an {@code int} can * have, 2<sup>31</sup>-1. */ @Native public static final int MAX_VALUE = 0x7fffffff;
@native documentation says
/**
* Indicates that a field defining a constant value may be referenced
* from native code.