Is there any way by which i can generate method headers in eclipse?
Eg:If i already have a method in my code:
public void doSomething(String name,String age){
}
Expected OP
/*
*This method does something
*@param name name of employee
*@param age age of employee
*/
public void doSomething(String name,String age){
}
Move the cursor beneath the main method, and enter the word private to make display a private method. Then, press Ctrl-Space to open code assist, as shown in Figure 3-8. Select the private static method item, and code assist will create the method template for you, as shown in Figure 3-9.
-Or- press Ctrl+Shift+T (for a type) or Ctrl+Shift+M (for a method). The "Open Type/Method" dialog will appear. If a type/method was previously selected in the editor or outline views, it will be displayed.
The method header comprises the access modifiers (public static), return type (int), method name (min), and parameters (int a, int b); if this method threw any exceptions, they would appear next. We should be very familiar with reading method headers in Javadoc from a previous lecture.
Type
/**
Enter
Afterwards Eclipse will generate you a default java-doc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With