declaring integer arrays

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alice_rari
    New Member
    • Jun 2006
    • 1

    #1

    declaring integer arrays

    How can i declare integer array in a jsp page?
    I want to call a method which returns an array of integers.
  • sateesht
    New Member
    • Apr 2007
    • 41

    #2
    Hi

    we can write the Java Code in Jsp using Scriptlets, aas below:

    Code:
     <% 
    int[] i =new int[10];
    %>
    if you want to call a method which returns an integer array, then use the following:
    your method definition should be as follows:

    Code:
     public int[] method1() 
    {
    int[] i=new int[10];
    //your code 
     
    return i;
    }
    if you want to make use this method:

    Code:
    int[] j=<classref>.method1();

    cheers,
    Sateesh.
    Last edited by r035198x; Apr 23 '07, 07:28 AM. Reason: added the missing code tags

    Comment

    Working...