Re: 2D array

From: Roedy Green (look-on_at_mindprod.com.invalid)
Date: 05/12/04


Date: Wed, 12 May 2004 09:06:56 GMT

On Wed, 12 May 2004 06:27:33 GMT, "D. Beckham"
<lekhanh88@earthlink.net> wrote or quoted :

>Would someone shows me the java syntax to create a 2D array of a calendar,
>where the rows represents months, such as: Jan, Feb... and columns represent
>days; assuming that there are 29 days in Feb? I don't know whether to
>declare this 2D array in String or int, since the months are string while
>days are int. Thanks
 I posted some code to create a calendar in HTML earlier today in
comp.lang gui in the thread
"need help with 2D array".

you could take that and combine it with the code in
http://mindprod.com/jgloss/gotchas.html#MATRIX

to creata a matrix of objects of days, including dummies on front and
end so that grid always starts with Sunday.

-- 
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Relevant Pages

  • (patch for Bash) regex conditional tests
    ... 'regex' are returned in array variable SUBMATCH. ... Skipping of positional parameters, array elements, string ... int dollarflag, zeropad, compareflag; ... SHELL_VAR *var; ...
    (comp.unix.shell)
  • Re: passing char arrays by reference
    ... I want to pass an array of strings to a function: ... int stuff{ ... stuff is an incompatible pointer type. ... string type; a "string" is a data format, ...
    (comp.lang.c)
  • Re: String of numbers into to array of numbers
    ... then read that string and have the string show the ... individual numbers as in an array. ... int arryCnt = 0; ... qStr= cStr.substring); ...
    (comp.lang.java.help)
  • Re: How to Return an array of strings in C (char**)
    ... int start=0; ... // to know the number of elements in the array ... The reason is that you fail to increment str. ... The you could have printed "here" before entering the main loop to see if you actually got there, then str + start to see where you go to in the string on each pass. ...
    (comp.lang.c)
  • Re: read keyboard input and storing in an array?
    ... When in a loop, how do I simply ... The data returned by 'br.readLine' would always be a String so I've stored ... simply convert it to an int as follows: ... you could copy 'myInt' to your array. ...
    (comp.lang.java.help)