//8.
//----------------------------------------------------------------
//-------- Display orignal and encrypted message information
//----------------------------------------------------------------
private void displayEncryptedMessage(String originalMessage, String encryptedMessage) {
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("Enter Message to be encrypted: ");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println(" Plain Text : " + originalMessage);
}
// 9
//----------------------------------------------------------------
// Encrypted it by substituting the character with the corresponding character in the cipher.
//
//----------------------------------------------------------------
private void encrypt(String cipher){
int letterPosition;
String encryptedMessage = "";
String originalMessage = Keyboard.readInput();
displayEncryptedMessage(String originalMessage, String encryptedMessage);
for (letterPosition=0; letterPosition<originalMessage.length(); letterPosition++){
char replaceCipherLetter = cipher.charAt(letterPosition);
encryptedMessage += replaceCipherLetter;}
System.out.println(" Cipher Text: " + encryptedMessage);
}
정말 자바에 새로운 것이므로 모든 의견을 크게 평가할 수 있습니다. 방법 8은 무효입니다. 어떤 값을 반환하지 않습니까? 내가 8을 9에 넣으려고한다면, displayEncryptedMessage(String originalMessage, String encryptedMessage);
은 이드가 매개 변수로 넣은 것입니까? 이러한 오류가 발생하는 이유는 무엇입니까? 당신이 메서드를 호출하는 경우
오류 : ')'예상 오류 : 불법적 인 표현의 시작
Error: ')' expected
Error: illegal start of expression
나는 이것이 일종의 클래스로 싸여 있다고 가정하고 있습니까? – christopher