我想製作一個加密程序。語法錯誤,插入「最後」來完成BlockStatements不能修復
我該如何擺脫「語法錯誤,插入‘終於上線100
<imports>
public class Afp {
...
/**
* Initialize the contents of the frame.
*/
private void initialize() {
....
JButton btnEncrypt = new JButton("Encrypt");
btnEncrypt.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try{
String text;
StringBuffer passWord = new StringBuffer(""+ text);
for(int i = 0; i < passWord.length(); i++){
int temp = 0;
temp = (int)passWord.charAt(i);
temp = temp*9834/8942 /33 *90023243 * 9 +124324534 - 2335 *24324;
passWord.setCharAt(i, (char)temp);
}
}
}
});
...
}
}
'try'塊需要'catch'或/和'finally'。 –
我刪除了第二個問題,將整個問題從「太寬」關閉。請將獨立(即不相關)的問題作爲不同的問題提出。 –