Java – handling enumerations in 2.0

This question refers to 1.2 Version 1, it does not compile in different parts, so it is not repeated

I want to use enumeration in processing I've seen them work better in a separate document, so I've done it This code compiles correctly:

enum Status
{
    STOPPED,MOVING
};

But when I have this code

Status status;

In a different file, it gave me the following error:

Unrecognized type:46 (ENUM_DEF)

I know that enumerations are not supported in earlier versions of processing, but they are supported in version 2.0? If so, what caused the error?

Solution

When you create a new tag for your enumeration, do you attach it java? In your case, your new tab is called status java?

Your code compiles me with the main tag content in process 2.0b6:

Status status;

There is another one called status The new tab of Java is as follows:

enum Status
{
    STOPPED,MOVING
};
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>