fork download
  1. package com.example.myapp;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.view.View;
  7. import android.widget.Button;
  8. import android.widget.Toast;
  9.  
  10. public class A extends Activity {
  11. @Override
  12. public void onCreate(Bundle savedInstanceState) {
  13. super.onCreate(savedInstanceState);
  14. setContentView(R.layout.main);
  15. Button button= (Button) findViewById(R.id.button);
  16. button.setOnClickListener(new View.OnClickListener() {
  17. @Override
  18. public void onClick(View v) {
  19. Intent intent=new Intent(A.this,B.class);
  20. startActivity(intent);
  21. }
  22. });
  23. setTXT();
  24. }
  25. private void setTXT(){
  26. Toast.makeText(getApplicationContext(),"Привет",Toast.LENGTH_SHORT).show();
  27. }
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. package com.example.myapp;
  36.  
  37. public class B extends A{
  38. }
  39.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:35: error: class, interface, or enum expected
package com.example.myapp;
^
1 error
stdout
Standard output is empty