So, in C# one of my favorite things to do is the following:
public class Foo
{
public static readonly Bar1 = new Foo()
{
SomeProperty = 5,
AnotherProperty = 7
};
public int SomeProperty
{
get;
set;
}
public int AnotherProperty
{
get;
set;
}
}
How would I write this in Java? I'm thinking I can do a static final field, however I'm not sure how to write the initialization code. Would Enums be a better choice in Java land?
Thanks!