Wrox Programmer Forums
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2007, 05:25 AM
Registered User
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default arrays

i am writng a program dat will generate 12 x 12 time table and i am using 2 dimensional array,i read in one of the wrox books that when one index is fied and the other varys then it generates column and if it is the other way round then rows are generated,but in my own case the whole thing came out as column,ie
1x1=1
1x2=2 etc,what can i do to make it in row and column

 
Old January 26th, 2009, 03:29 AM
Registered User
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To create a two dimensional array u should declare the array as like this

int twoDimen[][] = new twoDimen[3][3];

This will create 3*3 integer type array.Go ahead.thanks.
 
Old January 27th, 2009, 12:10 AM
jomet
Guest
 
Posts: n/a
Default

check this,
http://www.tutorialhero.com/tutorial-76-java_arrays.php
 
Old February 11th, 2009, 08:02 AM
Registered User
 
Join Date: Feb 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs down

Quote:
Originally Posted by roy_anup132 View Post
To create a two dimensional array u should declare the array as like this

int twoDimen[][] = new twoDimen[3][3];

This will create 3*3 integer type array.Go ahead.thanks.
Wrong !! declaration.. it should be

int twoDimen[][] = new int[3][3];
 
Old April 11th, 2009, 11:08 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Or int[][] twoDimen = new int[3][3];

Java takes both forms.
 
Old April 11th, 2009, 11:10 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Quote:
Originally Posted by Abraham View Post
i read in one of the wrox books that when one index is fied and the other varys then it generates column and if it is the other way round then rows are generated,
What they said in the book is correct and they are talking about traversing.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help With Arrays Crippy Ruby 2 March 6th, 2013 05:59 PM
arrays ozPATT Excel VBA 2 November 4th, 2005 06:11 AM
Multidemmesional Arrays OR arrays gmoney060 Classic ASP Basics 3 November 1st, 2004 03:42 PM
Arrays tajin Excel VBA 0 June 20th, 2004 09:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.