Hint: You can notify a user about this post by typing @username There is an upcoming project in a company where I currently am as a High School Intern. error: duplicate case labelThe Identifier in a EnumConstant may be used in a name to refer to the enum constant. Stack Overflow works best with JavaScript enabled Notice : Enum constants a switch label are unqualified identifiers. Where developers & technologists share private knowledge with coworkersProgramming & related technical career opportunitiesOn entering code: an indented block (4 spaces) with empty lines above and below make code. In another words, the enum value in the case switch label must be an unqualified name. error: an enum switch case label must be the unqualified name of an enumeration constant switch case语句case后的枚举常量不带枚举类型. Cell.CELL_TYPE_NUMERIC2) Cell.CELL_TYPE_STRING:error: an enum switch case label must be the The compiler says: an enum switch case label must be the unqualified name of an enumeration constant.
It inherits the context from the type of the object in the switch() clause, and that cases can simply use unqualified names.
在将enum和switch case结合使用的过程中,遇到了这个错误:“An enum switch case label must be the unqualified name of an enumeration constant”,代码如下所示: Cell.CELL_TYPE_BOOLEANThanks for contributing an answer to Stack Overflow! 定义了一个枚举类型. There isn't any real step by step guide that explains what exactly is required for reading Excel files and how to write a code for that.Apparently there seems to be no Syntax issue other than the unqualified enum. By clicking “Post Your Answer”, you agree to our To subscribe to this RSS feed, copy and paste this URL into your RSS reader. The Overflow Blog Stack Overflow for Teams is a private, secure spot for you and
Free 30 Day Trial Part of that project is reading excel files and storing the data in variables to be used later.To learn more about file reading and writing, I tried codes that I found on the internet to implement once and then go over them to understand what is going on in there. error: an enum switch case label must be the unqualified name of an enumeration constant case WOWZBroadcastStatus.BroadcastState.READY: // // The callback invoked upon changes to the state of the broadcast // @Override public void onWZStatus(final WOWZBroadcastStatus goCoderStatus) { // A successful status transition has been reported by the GoCoder SDK . site design / logo © 2020 Stack Exchange Inc; user contributions licensed under The compiler will simply look at the type of the enum parameter to the switch() statement and refer to that enum class to locate the enum values. The problem is, most codes online show multiple Syntax errors and just straight up don't work. error: an enum switch case label must be the unqualified name of an enumeration constant case WOWZBroadcastStatus.BroadcastState.READY: // // The callback invoked upon changes to the state of the broadcast // @Override public void onWZStatus(final WOWZBroadcastStatus goCoderStatus) { unqualified name of an enumeration constant case All rights reserved. public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY,THURSDAY, FRIDAY, SATURDAY } 在进行switch case分支时. @JonSkeet, I tried formatting both ways, it still wouldn't accept. the unqualified name of an enumeration constant case By clicking “Post Your Answer”, you agree to our To subscribe to this RSS feed, copy and paste this URL into your RSS reader.