Results 1 to 7 of 7
Thread: illigel expression
- 05-08-2009, 02:41 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 14
- Rep Power
- 0
illigel expression
hey why im getting this
here is my codeJava Code:Calendar.java:11: illegal start of expression static String[] daysstr = new String[] {"\t|Sun","\t|Mon","\t|Tues","\t|Wed", "\t|Thurs","\t|Fri","\t|Sat"}; ^ 1 error
Java Code:static String[] daysstr = new String[] {"\t|Sun","\t|Mon","\t|Tues","\t|Wed","\t|Thurs","\t|Fri","\t|Sat"};
- 05-08-2009, 02:50 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
If this is inside a method, it can't be static.
Edit: And, if it's not inside a method, then you haven't ended the previous line properly.
- 05-08-2009, 03:26 PM #3
Member
- Join Date
- Apr 2009
- Posts
- 14
- Rep Power
- 0
- 05-08-2009, 03:50 PM #4
Just try it
Why not just try it and see what happens.should i remove static
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 05-08-2009, 04:11 PM #5
Member
- Join Date
- Apr 2009
- Posts
- 14
- Rep Power
- 0
this is the output
[Ljava.lang.String;@757aef
- 05-08-2009, 04:30 PM #6
You have an array of Strings and when you call println(Day_str) it prints out the array object not the data inside it. You need a loop from 0 to day_str.length()-1 and then println(day_str[xx])
Liberty has never come from the government.
Liberty has always come from the subjects of government.
The history of liberty is the history of resistance.
The history of liberty is a history of the limitation of governmental power, not the increase of it.
- 05-09-2009, 12:09 AM #7
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
Correction to xcallmejudasx's post: it should be from 0 to Day_Str.length - 1, or for(int i=0; i<Day_Str.length; i++). using Day_Str.length() would just throw exceptions because the length() method does not exist. You use a method to get the size of an ArrayList, and it is size() not length().
If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
Similar Threads
-
need help to make this regular expression
By aruna1 in forum New To JavaReplies: 1Last Post: 04-12-2009, 08:09 PM -
Quick reg. expression help
By RR_QQ in forum New To JavaReplies: 4Last Post: 02-10-2009, 07:51 PM -
illegal start of expression
By razmyasdfg in forum CLDC and MIDPReplies: 2Last Post: 07-27-2008, 10:44 PM -
Illegal Start of an Expression
By David55 in forum CLDC and MIDPReplies: 8Last Post: 11-02-2007, 09:11 PM -
Boolean Expression
By ritwik07 in forum New To JavaReplies: 3Last Post: 07-11-2007, 04:11 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks