#if在java中,像在c处理器中 [英] #if in java, like in c preprocessors

查看:384
本文介绍了#if在java中,像在c处理器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何标记java代码,使其不被编译

c ,我们可以阻止编译这样的块代码:

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

#if 0

    //code here

#endif

所以即使代码块容易出错,代码编译,我想在Java中使用相同的东西,所以我可以跳过那些不能编译的代码,因为某些库缺少。

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.

有谁可以帮我吗?

推荐答案

您必须注释掉代码,否则无法使用预处理器指令java的。

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

这篇关于#if在java中,像在c处理器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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