Initializing Array

Java makes it easy to initialize an array with constants:


String[] months = {"", "January", "February",
                   "March", ... };

String[] days = {"Monday", "Tuesday",
                 "Wednesday", ... };

String[][] phone = {{"Vader",     "555-1234"},
                    {"Skywalker", "472-2123"},
                    ... }

Contents    Page-10    Prev    Next    Page+10    Index