I suppose I should elaborate...

In C++, you should use const to declare TRUE_CONDITION to be true, and
then use regular 'if' statements. The compiler will eliminate the
clauses that can't be reached.

In Java, you can do the same thing. But since Java code generally can
run on any platform, you generally do not WANT conditional
compilation, as it would make your code break when you moved it to
another environment.

This isn't an issue for C++ or C because the compiled files aren't
portable anyway.

On Mar 30, 3:36 am, Bob Kerns <[email protected]> wrote:
> You do not do that in Java.
>
> I suggest you should not do that in C++, as there are better ways to
> do it.
>
> I suggest you do not use C.
>
> On Mar 30, 2:57 am, Dilip Dilip <[email protected]> wrote:
>
>
>
> > Hi All,
> >  How to do conditional compilation in JAVA.
>
> > something like in C, C++ :
>
> > #ifdef TRUE_CONDITION
>
> > #else
>
> > #endif
>
> > Thanks and Regards,
> >   Dileep

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to