#如果在Java中,类似于C preprocessors [英] #if in java, like in c preprocessors

查看:147
本文介绍了#如果在Java中,类似于C preprocessors的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/8293124/how-to-mark-java-$c$c-such-that-its-not-compiled">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.

这篇关于#如果在Java中,类似于C preprocessors的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆