Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Feb 17th, 2005, 12:34 AM   #1
thenewkid
Programmer
 
Join Date: Sep 2004
Location: New Jersey
Posts: 36
Rep Power: 0 thenewkid is on a distinguished road
Send a message via AIM to thenewkid
lost

hey...
im was writing the code for the game of life..u prob have herd about that ..im almost done...i just need add the code which determines which gameboard the user wants to use...here i got stuck lol..at the very end...
im gettin .class expected error
here is the sample code with the identical error......

public class test
{
	public static void main(String[] args)
	{
		int sel = 2;

		int array[][] = null;
		
		if(sel == 2)
		    int array[][] = {{2,2},
				         {2,2}};
		else
		    int array[][] = {{0,0},
				         {0,0}};

		for(int i = 0; i < array.length; i++)
		{
			 System.out.println();
			 for(int j = 0; j < array[0].length; j++)
			  {
				System.out.print(array[i][j] + " ");
			  }
		}
	}
}

all i found on the net was that this error is commonly caused by extra, or missing bracket...please help!!
thanx
thenewkid is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:38 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC