incompatible types: int cannot convert to String

how to solves this kind of error?

  • java

    Votes: 0 0.0%
  • netbeans

    Votes: 1 100.0%

  • Total voters
    1

Joined
Jul 9, 2015
Messages
1
Reaction score
0
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {




String name;
name = jTextField1.getText();

int i;

for(i=0;i<std.length;++i)
{
if(std.getName().equals(name))
{
jTextField2.setText(name);
jTextField3.setText(((Student)std).calcYob());
jTextField4.setText(((Student)std).calcAge());
jTextField5.setText(((Student)std).calcGender());
jTextField6.setText(((Student)std).calcBmi());

break;
}
}
}
 
Ad

Advertisements

Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top