title: Compiler error: “class, interface, or enum expected”
body: <p>I have been troubleshooting this program for hours, trying several configurations, and have had no luck. It has been written in java, and has 33 errors (lowered from 50 before)</p>
  
  <pre><code>setContentView(R.layout.activity_main);
  
          sendBtn = (Button) findViewById(R.id.btnSendSMS);
          txtphoneNo = +913331234567;
          txtMessage = (EditText) findViewById(R.id.editText2);
  
          sendBtn.setOnClickListener(new View.OnClickListener() {
  public void onClick(View view) {
          sendSMSMessage();
          }
          });
          }
  protected void sendSMSMessage() {
          Log.i("Send SMS", "");
          String phoneNo = txtphoneNo.getText().toString();
          String message = txtMessage.getText().toString();
  
          try {
          SmsManager smsManager = SmsManager.getDefault();
          smsManager.sendTextMessage(phoneNo, null, message, null, null);
          Toast.makeText(getApplicationContext(), "SMS sent.", Toast.LENGTH_LONG).show();
          }
  
          catch (Exception e) {
          Toast.makeText(getApplicationContext(), "SMS faild, please try again.", Toast.LENGTH_LONG).show();
          e.printStackTrace();
          }
          }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
          }
          }
  </code></pre>