Question:
Whats wrong with this syntax?
Izzy
2012-01-14 11:35:20 UTC
Im getting a couple of errors:
Multiple markers at this line
- Syntax error, insert ";" to complete Statement
- Syntax error, insert "}" to complete ClassBody
- Syntax error, insert ";" to complete
ConstructorDeclaration
- Syntax error, insert ")" to complete
ConstructorDeclaration
- Syntax error, insert ")" to complete
MethodInvocation

for

package android.app;
import android.app.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;



public class activity2 extends Activity{

/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main2);

Button next = (Button) findViewById(R.id.Back);
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent();
setResult(RESULT_OK, intent);
finish();
}
Button sound = (Button) findViewById(R.id.sound);
setOnClickListener(new View.OnClickListener(); {
@Override
public void onClick(View v); {
MediaPlayer mp = MediaPlayer.create(TestSonido.this, R.raw.slayer);
mp.start();
}

;
}
;
}
}
Three answers:
anonymous
2012-01-14 12:01:13 UTC
you should have matched sets of {} and (), which you do not.

one simple method is to count the number of { and (. Then count the

number of } and ). in each case they should be equal.

scroll thru the code for (. The ) should be close by.

draw a line between each { and its associated }. should show what's missing

The error codes you mention are pretty descriptive

HTH
anonymous
2017-01-10 03:01:09 UTC
right this is how i would fix it. The solar--now shining brightly--famous punctures interior of the clouds as they sail lazily around the sky. the vivid flowers slouch casually, following the solar's path satisfactorily. Now, the final sentence is puzzling by means of actuality it would not paint a real sparkling image to have slouch and following. Tweak that sentence/part fairly greater to reveal greater suited what you're attempting to portray! additionally constantly try to write down in latest demanding and don't change among tenses, it receives too puzzling.
Nace
2012-01-14 11:45:33 UTC
Looks like you've just forgotten to place a few symbols. It surely told you which like had the error, try placing the symbols where it tells you they are missing.



Next time try using www.codepad.org


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...