-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,312
  • 3
  • 25
  • 42

2 Answers2

0

This is how BigInteger.ZERO is defined :

public static final BigInteger ZERO = new BigInteger(new int[0], 0);
Manos Nikolaidis
  • 20,422
  • 12
  • 68
  • 75
0
public class SomeClass {
    public static final type CONST_NAME = new SomeObject();

    ...
}

Then you can do SomeClass.CONST_NAME

leeor
  • 15,861
  • 6
  • 32
  • 58