尝试编译我的应用程序时出现许多错误。
这是我的界面...
public interface userMessage {
public enum DisplayMessageID {
VALID, CMD_ERR, LOAD_ERR,
SAVE_ERR, DELETE_ERR, CONVERT_ERR,
FORMAT_ERR
}
String subuserMessage(DisplayMessageID DispMess);
}
这是我的一堂课...
package terminal;
public class UserCommunication implements userMessage {
public DisplayMessageID DisplayMessageID;
public UserCommunication (DisplayMessageID displaymessageid ) {
this.DisplayMessageID = displaymessageid ;
}
// a method for Displaying messages
public String subuserMessage(DisplayMessageID DispMess) {
switch (DispMess) {
case CMD_ERR :
System.out.println("Terminal Sw Module cannot able to intrepret the input Command");
break;
case LOAD_ERR :
System.out.println("Controller reports there is problem in fetching the file:" + "\n" +
"1 Check if the source file exits in Database" + "\n" +
"2 Check if Source path is right" + "\n" +
"3 Check if you have access to Database");
break;
default:
System.out.println("VALLIDD.");
break;
}
return "ddd";
}
}
这是我的主要程序...
package terminal;
import terminal.userMessage.DisplayMessageID;
public class DisplayMessage() {
public static void main(String[] args) {
UserCommunication user_comm_to_terminal = new UserCommunication(DisplayMessageID.LOAD_ERR);
System.out.println("Height of rectOne: ");
}
}
这些是我在尝试编译时遇到的错误......
- 在线,
public class Displaymessage
:--- Syntax error on token "class", @ expected
在线,
public static void main(String[] args)
:-Multiple markers at this line - Syntax error on token "void", @ expected - Syntax error, insert "enum Identifier" to complete EnumHeader - Syntax error, insert "]" to complete ArrayAccess - Syntax error on token "]", invalid ( - Syntax error, insert ")" to complete SingleMemberAnnotation
最后一行,
} :- Syntax error on token "}", delete this token
我无法弄清楚这些错误。任何帮助都会很棒。