Results 1 to 4 of 4
Thread: java arrays need help
- 07-23-2010, 11:12 PM #1
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
-
When I Googled -- java 2d array -- the first and third hit (the second is simply the 2nd page of the first hit), looked decent enough to get you started.
Luck.
- 07-24-2010, 12:13 AM #3
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
hey thanks am tryin to hold 3 lines of values into a 2D array would i do this by
import java.util.*;
public class array{
public static void main(String[] args){
int num[] = { {50,20,45,82} {25,63,10,16} {12,3,45,82} };
or sumfing like this
int array1 [] {50,20,45,82}
int array2 [] {25,63,10,16}
int array3 [] {12,3,45,82}
- 07-24-2010, 12:42 AM #4
Have you tried asking the compiler what it thinks about your code? You'll often get a quicker response than waiting for someone on a forum.
Correct the first by adding another set of [] and some commas
int num[][] = { {50,20,45,82}, {25,63,10,16}, {12,3,45,82} };Last edited by Norm; 07-24-2010 at 12:44 AM.
Similar Threads
-
Java Phonebook With Arrays // HELP! //
By K-Scale in forum New To JavaReplies: 9Last Post: 10-04-2011, 03:41 AM -
Arrays.sort... why sorting all arrays in class?
By innspiron in forum New To JavaReplies: 6Last Post: 03-23-2010, 01:40 AM -
java arrays
By miko5054 in forum New To JavaReplies: 15Last Post: 03-18-2010, 05:17 PM -
arrays in java
By mayhewj7 in forum New To JavaReplies: 4Last Post: 12-17-2008, 03:48 AM -
Arrays in Java
By hiranya in forum New To JavaReplies: 3Last Post: 07-30-2007, 09:10 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks