I like to organize my Java files a little and would like to know if there is a standard way of doing this. For example:
public class Example
{
private int exampleInt;
private String exampleString;
/*------------------------------------------------------------*/
/* I N N E R C L A S S E S */
/*------------------------------------------------------------*/
private someInnerClass
{
someInnerClass()
{
}
}
/*------------------------------------------------------------*/
/**
* This method returns the example int.
*/
public int getExampleInt() {
return exampleInt;
}
}
I don’t what to call the part where I have a sort of comment break
/—————————————————————–/
Is there any sort of convention for this sort of thing? Or is this something that I should just not be doing because most IDE’s will display everything nicely to you in some sort of outline view?
Refactoring and source cleanup may cause your source files to be reorganized, including comments.
I would suggest you do not do that since that comment may end up somewhere completely unrelated.
Another thing you may want to try instead is to use your IDE to reformat your source. Eclipse allows for doing that every time you save a file. This will give all your code a consistent look allowing for easier reading.