Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

link : http://download.java.net/jdk8/docs/api/java/lang/annotation/Native.html

In Java 8, there will be @Native annotations.

Indicates that a field defining a constant value may be referenced from native code. The annotation may be used as a hint by tools that generate native header files to determine whether a header file is required, and if so, what declarations it should contain.

Problem is: What for? Do you have any idea on which problematics would be efficiently solved by this feature?

share|improve this question
 
allowing of the value being cached which eliminated the expensive call to get the value –  ratchet freak Nov 15 '13 at 14:33
add comment

1 Answer

up vote 3 down vote accepted

Imagine a header which defines constants to be used in messaging. One party of the conversation might be developed in C++, and they'd like to #include a header. Now maintaining two similar but separate files is a risk; deriving the C++ header from @Native constants is safer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.