Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #12649 > unrolled thread

why it is incorrect expression?

Started bygearss8888@gmail.com
First post2012-03-03 20:31 -0800
Last post2012-03-03 22:44 -0800
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  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

#12649 — why it is incorrect expression?

Fromgearss8888@gmail.com
Date2012-03-03 20:31 -0800
Subjectwhy 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]


#12653

Frommarkspace <-@.>
Date2012-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