public class MainActivity extends AppCompatActivity { EditText editTextad,editTextkw,editTextsaat; Button button; TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); editTextad=findViewById(R.id.editTextTextPersonName); editTextkw=findViewById(R.id.editTextTextPersonName2); editTextsaat=findViewById(R.id.editTextTextPersonName3); button=findViewById(R.id.button); textView=findViewById(R.id.textView); button.setOnClickListener(view -> { String ad=editTextad.getText().toString(); int kw=Integer.parseInt(editTextkw.getText().toString()); int saat=Integer.parseInt(editTextsaat.getText().toString()); ElektrikliCihaz elektrikliCihaz= new ElektrikliCihaz(); elektrikliCihaz.cihazAdi=ad; elektrikliCihaz.cihazKw=kw; elektrikliCihaz.cihazSaat=saat; int sonuc=elektrikliCihaz.aylikTuketim(); textView.setText(Integer.toString(sonuc)); }); } }