开发者

C-sharp's "#region" & "#endregion" in Java? [duplicate]

开发者 https://www.devze.com 2023-01-17 09:07 出处:网络
This question already has answers here: 开发者_如何转开发 Closed 10 years ago. Possible Duplicate:
This question already has answers here: 开发者_如何转开发 Closed 10 years ago.

Possible Duplicate:

Java equivalent to #region in c#

Is there something in Java that would allow for structuring the source code as it is done in C# with the pre-processor directives

#region

and

#endregion

?


No, there is nothing equivalent.

Code folding is an IDE feature, not a language feature.

Eclipse has code folding for classes and members when Java files are loaded in it. It may be extended (for example) to add code folding on carefully crafted comment lines.


No, there's no built-in solution to that.

However there are some Java IDE's which support folding for certain comment-patterns. And of course all IDE's support folding the code by classes, methods etc.


region is a language feature and NOT an IDE feature. Specifically, it is part of the C# programming language and Visual Studio knows how to interpret it.


Not as such. Bear in mind that these preprocessor directives are more for VS's benefit than they are a part of the C# or VB language spec. Preprocessor directives in Java would be the IDE's business.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号