shreyaas
April 19th, 2001, 09:56 AM
First of all i would like to thank Timo Hahn for his immediate response.
My query was
------------
Is there a way to conditionally compile the same source file with more than one version of java.
For example
-----------
In C if #ifdef and #else is specified, it differentiates,selects during COMPILE time the chunk of code and leaves the other chunk UNCOMPILED.
Like wise in java for the below given piece of code,on java1.1.8 version, i want only the "if" part to get COMPILED and leave uncompiled the "else" part.
if (java118)
{
//code for 1.1.8 should only get compiled
}
else
{
//code for 1.2.2 should not get compiled at all.
}
Please note the above query is in regard with COMPILE TIME.
Kindly clarify my doubt.
R.S.Govindarajan
My query was
------------
Is there a way to conditionally compile the same source file with more than one version of java.
For example
-----------
In C if #ifdef and #else is specified, it differentiates,selects during COMPILE time the chunk of code and leaves the other chunk UNCOMPILED.
Like wise in java for the below given piece of code,on java1.1.8 version, i want only the "if" part to get COMPILED and leave uncompiled the "else" part.
if (java118)
{
//code for 1.1.8 should only get compiled
}
else
{
//code for 1.2.2 should not get compiled at all.
}
Please note the above query is in regard with COMPILE TIME.
Kindly clarify my doubt.
R.S.Govindarajan