Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #12649 > unrolled thread
| Started by | gearss8888@gmail.com |
|---|---|
| First post | 2012-03-03 20:31 -0800 |
| Last post | 2012-03-03 22:44 -0800 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.java.programmer
why it is incorrect expression? gearss8888@gmail.com - 2012-03-03 20:31 -0800
Re: why it is incorrect expression? markspace <-@.> - 2012-03-03 22:44 -0800
| From | gearss8888@gmail.com |
|---|---|
| Date | 2012-03-03 20:31 -0800 |
| Subject | why it is incorrect expression? |
| Message-ID | <2998495.1917.1330835512013.JavaMail.geo-discussion-forums@ynlw24> |
I donot know why the following program cannot work, it says "keysTocutBysections = {{}}" is incorrect expression. please help.
public class GetAllContent {
String address;
String[][] keysTocutBysections;
public String GetAllCont (String addr, String keyword) {
address = addr;
if (address.indexOf("9") != -1) {
keysTocutBysections = {{}};
}
return "0";
}
public static void main(String[] args) {
GetAllContent xx = new GetAllContent();
xx.GetAllCont("99", "0");
}
}
[toc] | [next] | [standalone]
| From | markspace <-@.> |
|---|---|
| Date | 2012-03-03 22:44 -0800 |
| Message-ID | <jiv31c$km9$1@dont-email.me> |
| In reply to | #12649 |
On 3/3/2012 8:31 PM, gearss8888@gmail.com wrote:
> I donot know why the following program cannot work, it says "keysTocutBysections = {{}}"
> is incorrect expression. please help.
> keysTocutBysections = {{}};
Ayup, it's incorrect. What do you want help with? What were you
expecting that statement to do?
For an empty double array it's "new String[0][0];"
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web