0
I am programming in Java in Android Studio and there is an error .class expected:
package com.example.equacaodosegundograu;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
TextView txt1, txt2, txt3, total;
EditText edittext2, edittext3;
Button calc;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txt1 = (TextView) findViewById(R.id.txt1);
txt2 = (TextView) findViewById(R.id.txt2);
txt3 = (TextView) findViewById(R.id.txt3);
total = (TextView) findViewById(R.id.total);
edittext2 = (EditText) findViewById(R.id.edittext2);
edittext3 = (EditText) findViewById(R.id.edittext3);
calc = (Button) findViewById(R.id.calc);
calc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
float M = float.parseFloat;
float V = float.parseFloat(edittext3.getText().toString());
float ec = (M * (V * V)) / 2;
total.setText(Float.toString(ec));
}
})
;}
}