-3

How can I define a constant in my class that returns a object? What I'm looking for is something like BigInteger.ZERO

b_pcakes
  • 2,452
  • 3
  • 28
  • 45

2 Answers2

0

This is how BigInteger.ZERO is defined :

public static final BigInteger ZERO = new BigInteger(new int[0], 0);
Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82
0
public class SomeClass {
    public static final type CONST_NAME = new SomeObject();

    ...
}

Then you can do SomeClass.CONST_NAME

leeor
  • 17,041
  • 6
  • 34
  • 60