News:

Build a stunning handcrafted website with IT Acumens

Main Menu

Arrays

Started by sukishan, Sep 04, 2009, 03:50 PM

Previous topic - Next topic

sukishan

Arrays
As shown in the program that follows, using arrays is very similar to C#. Notice the get_Length() method used to get an array's length, as properties are not supported in J#.

package hks;
import System.*;
public class UseArrays
{
  public static void main()
  {
    String[] days_of_week = {
      "Sunday",
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday",
      "Saturday"
    };
    for (int i=0;i<days_of_week.get_Length();i++)
    {
      Console.WriteLine(days_of_week);
    }
  }
}
A good beginning makes a good ending