Issue
I'm new to Java.
I've been using Typescript to type my projects in the Front-end and I'm very used to creating String Literal Types to limit possible inputs. Is there any easy way to this in Java?
For eye candy, here's how you create it in Typescript:
type Easing = "ease-in" | "ease-out" | "ease-in-out";
Solution
No. The most similar thing is an enum Type.
public enum Easing {
EASE_IN, EASE_OUT, EASE_IN_OUT;
}
Answered By - Elliott Frisch
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.