why it is incorrect expression?

G

gearss8888

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");

}
}
 
M

markspace

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];"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top