1
如果我有一个准备好语句的类,当用户按下按钮时如何调用它们。如何在另一个类中调用Java类的变量
class updateeButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
name = displayName.getText();
price = bookPrice.getText();
Queries update = new Queries();???????????????????
}
}
在不同类
public int update(String price, String name) throws SQLException {
ps2.setString(1, name);
ps2.setString(2, price);
System.out.print("Update - ");
return ps2.executeUpdate();
}
除了可以实例化类在construtor或通而不是在方法内部创建更多的面向对象。 –
你会怎么做?如何显示返回价值。谢谢 – joe
请任何意见 – joe