I used this way to get code folding in Netbeans:
// <editor-fold defaultstate="collapsed" desc=" description">
....
// </editor-fold>
and Visual Studio:
#region description
...
#endregion
but I can't find the same usage in eclipse. How can i use code folding in Eclispe?
Eclipse supports code folding.
Go to workbench preferences -> General -> Editors -> Structured Text Editors, and check the "Enable folding" box.
Then go to workbench preferences -> Java -> Editor -> Folding, and adjust your folding preferences.