<<< Enumeration toString( ) override example | Index | static import statement >>> |
Code that uses the overridden toString() method:
ShippingType ground = ShippingType.UPS_GROUND; System.out.println( "toString: " + ground.toString() + "\n" );
Resulting output:
toString: UPS Ground (5 to 7 business days)
<<< Enumeration toString( ) override example | Index | static import statement >>> |