[Solved] Explanation for syntax


  • us is a variable of type (class) NumberFormat.
  • getCurrencyInstance() is a static method (a method of the class, not of an object). So this method is not related to a object. But this method generates an object of class NumberFormat (a kind of factory), that is stored in the variable us.
  • now that you have a NumberFormat object, you can use it to format the payment as a string (following certain rules defined in your us object)

solved Explanation for syntax