Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

generating method headers in eclipse

Tags:

java

eclipse

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){

    }
like image 569
user1053279 Avatar asked Nov 18 '11 07:11

user1053279


People also ask

How do I create a method in eclipse?

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.

How do I display a method in eclipse?

-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.

What is method header?

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.


1 Answers

Type

/**
Enter

Afterwards Eclipse will generate you a default java-doc.

like image 63
Udo Held Avatar answered Oct 06 '22 03:10

Udo Held