0
Why is this wrong?
I want to concatenate but it is giving errors. Can you help me..Please modify the code if it is wrong https://code.sololearn.com/ccbWvD8Teqqd/?ref=app
10 Answers
+ 2
Are you trying to concatenate the arrays or the strings?
+ 2
Here's a couple of examples
https://www.programiz.com/java-programming/examples/concatenate-two-arrays#:~:text=In%20order%20to%20combine%20(concatenate,by%20using%20arraycopy()%20function.
+ 2
Thanks alotđ„
+ 1
Well you have several problems with your code.
1. There isn't a concat method for Array or Arrays.
2. You didn't import Array or Arrays etc
3. You have syntax errors trying to use [] square brackets for your arrays or for the the method call (not sure which you intended due to placement). Parentheses are used with method calls. So if there were a concat method for the Array class then it would look more like;
Array.concat() // doesn't exist
Then arrays are made using curly braces {} like;
{1,2,3,4,5}
+ 1
Can you please modify and send me the code
+ 1
Javascript is not the same as Java.
+ 1
You are using Array declaration and concatenate methods of js in Java.
That works in js . But not in Java.
+ 1
Well, I'm not learning but I'm always in a class where java is being taught. The .concat() method you used only works in Javascript but not Java as both are not related in anyway.
0
Array
0
Is it same for JS?