Building an Argument List with Parameter Info

This example uses Statement Completion's Parameter Info feature to display information for a method's argument.

Note   If you have completed the steps of Creating Statements with Word Completion, Selecting an Overloaded Method, and Selecting Methods from a Member List, continue with the following procedure. If not, take a few minutes and work through those procedures before selecting a method for the String class.

Before proceeding, make sure you have loaded a .java file into the Text editor that contains the following code:

String myStr = new String("Hello World!");
if(myStr.equalsIgnoreCase

To select build an argument list with Parameter Info

  1. Continuing to build the if statement, type an opening parenthesis, "(", immediately after "myStr.equalsIgnoreCase".

    Parameter Info displays the method's declaration with the single parameter (String p1) in a bold-type font.

    Note   In this case, the method has only one parameter (String p1). If you select a method that takes more than one argument, IntelliSense displays argument types and positions within the method declaration. When you type the opening parenthesis after the method's name, IntelliSense bolds the first argument. As you add commas between the arguments, IntelliSense bolds the type and position information for the next argument that's needed to complete the method's call.

    Tip   If you do not get a pop-up window with parameter information after you type the opening parenthesis, select Parameter Info from the Edit menu or use the keyboard shortcut, CTRL+SHIFT+I. If this continues to happen, make sure you've enabled the Statement Completion feature.

  2. After the opening parenthesis, complete the statement by typing:
    "hello world!"))
    

    The completed if statement should look like the following:

    if(myStr.equalsIgnoreCase("hello world!"))
    
  3. Using the Statement Completion's Word Completion, Member List, and Parameter Info options, complete this example by adding the following code after the closing parenthesis of the if statement:
       {
    System.out.println("The strings are the same.");
    }
    else
       {
    System.out.println("The strings are different.");
    }
    return;
    
  4. Build the program.

  5. In the Text editor, place the cursor on "return" (the last statement of this program's code). Click the right mouse button and select Run To Cursor from the shortcut menu.

  6. View the following results in JVIEW's console window:
    The strings are the same.