Question

I understand there are number of problems we have with this during compilation in previous languages

like for example ::

#define PI_PLUS_ONE (3.14 + 1)
x = PI_PLUS_ONE * 5; // a line of code

if i don't use parenthesis i will be getting different result than the expected output. So what i want to say is if we understand it very well we can take it advantages one of it is type neutral in defining constants.

What Are the reasons(main) behind the restriction of this headers in java?

Thanks in Advance for help!

Était-ce utile?

La solution

There is pre-processing in Java, just not the type you describe. Consider Hibernate or the Proxy/Decorator patterns that are available in Java by bytecode instrumentation, etc. This is the pre-processing, adapted for the enterprise.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top