you didnt instanciate greeting
so you would do
public class Welcome {
public static void main(String[] args) {
String[] greeting = null; //I need to exist before you start
inserting things into me
greeting[0] = "Welcome";
greeting[1] = "howdy";
for (String g : greeting)
System.out.println(g);
}
}
On Tue, 21 Dec 2004 11:10:05 -0500 (GMT-05:00), Michael Greenberg
<[EMAIL PROTECTED]> wrote:
> Did you try just using javac ?
>
> -----Original Message-----
> From: Critter <[EMAIL PROTECTED]>
> Sent: Dec 21, 2004 11:05 AM
> To: CF-Talk <[email protected]>
> Subject: [OT] Eclispe and Java
>
> I am just trying to build a simple class file using eclipse.. but I
> keep getting syntax errors..
>
> public class Welcome {
>
> public static void main(String[] args) {
> greeting[0] = "Welcome";
> greeting[1] = "howdy";
>
> for (String g : greeting)
> System.out.println(g);
> }
> }
>
> Severity Description Resource In Folder Location
> Creation Time
> 2 Syntax error on token ")", invalid
> AssignmentOperator Welcome.java Welcome line 20 December 21, 2004
> 10:51:12 AM
> 2 Syntax error on token(s), misplaced
> construct(s) Welcome.java Welcome line 20 December 21, 2004 10:51:12
> AM
>
> i am thinking it has to do with maybe eclipse using the wrong jre...
> but i am not sure.. I've pointed eclipse to use the newer jdk.. (i
> think..) any suggestions?
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-[ Single Dads ]-=
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-[ http://single-dads.us ]-=
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188377
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54