Ask your own question, for FREE!
Mathematics 14 Online
OpenStudy (anonymous):

Anyone here know a little bit of Java programming?

OpenStudy (anonymous):

No one is in the computer science section

OpenStudy (anonymous):

Which of the following statements contains incorrect syntax? String[] s = {"one", "two", "three"}; int[] i; char[] c = {'a', 'b', 'c'}; double z = new double[5];

OpenStudy (bibby):

D is the only array declared without brackets

OpenStudy (anonymous):

B is also that way

OpenStudy (anonymous):

isn't it?

OpenStudy (bibby):

arrays are declared: ``` String[] myStringArray = new String[3]; String[] myStringArray = {"1","2","3"}; ```

OpenStudy (bibby):

it's declared but not instantiated

OpenStudy (anonymous):

oh....

OpenStudy (bibby):

nothing wrong with the statement in B syntactically

OpenStudy (anonymous):

okay cool. hey would you mind looking over some other questions I answered bibby?

OpenStudy (kainui):

I would just try to run these and see if they work or not, it's probably faster and better for you

OpenStudy (bibby):

ACTUALLY YES I WOULD MIND

OpenStudy (anonymous):

Oh ok

OpenStudy (bibby):

I agree with kai, find an online java compiler tag me in your future questions though, I don't mind

OpenStudy (anonymous):

lol :P

OpenStudy (anonymous):

yea I'm gunna use my eclipse compiler to see if it works

OpenStudy (anonymous):

You were right D doesn't work in the compiler. I also checked the other 3

OpenStudy (anonymous):

OpenStudy (anonymous):

OpenStudy (anonymous):

I answered all of them but could you look them over @bibby

OpenStudy (anonymous):

I don't need direct answers. just a simple "that one is wrong that one is wrong" would suffice

OpenStudy (bibby):

not sure about 1,sorry. 6,7 so far are wrong the rest seem alright as far as I can tell

OpenStudy (anonymous):

okay I'll look em over. thanks :)

OpenStudy (anonymous):

For 6 it's got to be x.size(); then right cuase I don't think it would be without the "()" would it?

OpenStudy (bibby):

give me a second to try it out actually

OpenStudy (anonymous):

okay

OpenStudy (anonymous):

hmm 7 must be backwards then so it must be (double g : z) System.out.println(g);

OpenStudy (bibby):

yeah 7, was backwards. we want every double in the array z ``` for(type element:container) ``` 6, arrays have an attribute called length. x.length is what you want

OpenStudy (bibby):

by element I meant a local identifier

OpenStudy (anonymous):

huh okay that makes sense I guess.

OpenStudy (anonymous):

lets see how well I did with the fabulous assistance of Bibbity

OpenStudy (anonymous):

9/10

OpenStudy (bibby):

which one was wrong?

OpenStudy (anonymous):

:) pretty good lol crap I accidentally selected the wrong bubble on number 7 and didn't notice my mistake

OpenStudy (bibby):

tsk tsk tsk

OpenStudy (anonymous):

so sad I know lol. it's okay though.

OpenStudy (anonymous):

As long as I understand what is going on I'm not too worried about getting a perfect score

OpenStudy (bibby):

you still bring a great shame on our family

OpenStudy (anonymous):

D:

OpenStudy (anonymous):

I shall take this wrong to the teacher and fight for my right to fix my shameful action

OpenStudy (bibby):

good on you. now go write some fun little programs to get the syntax ingrained in you. later dude

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!