RE C# enums with the flag attribute:
http://dotnetperls.com/enum-flags
is there any way to get this behavior in Java?
The closest thing you can get is a struct .
Parameters in C functions There are two ways to pass parameters in C: Pass by Value, Pass by Reference.
1. C Classes. A class consists of an instance type and a class object: An instance type is a struct containing variable members called instance variables and function members called instance methods.
Java doesn't have pointers; Java has references.
As long as you define your Enum values properly, you can use EnumSet to get that functionality.
RenderSet set = RenderSet.DataUri | RenderSet.GZip;
would become
EnumSet.of(RenderSet.DataUri, RenderSet.GZip);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With