#如果在Java中,类似于C preprocessors类似于、Java、preprocessors

2023-09-06 04:33:01 作者:月色映出悲丶

可能重复:   How标记的Java code这样的,它不是编译

在Ç,我们可以$ P $块code这样的pvent编译:

In c, we can prevent compilation of block code like this :

#if 0

    //code here

#endif

所以,即使code块是容易出错的code编译,我希望在Java中同样的事情,所以,我可以跳过code那部分不能编译,因为有些库失踪了。

So even if code block is error prone the code compiles, I want the same thing in Java, So that I can skip that part of code which won't compile because some library is missing.

谁能帮我?

推荐答案

您必须为注释掉code ,则不能使用pre处理器指令在java中。

You have to comment out the code, you can't use pre-processor directive in java.