The code in Java implements two classes Order and CustomerOrder
The Order class contains the method for the member variables orderNum,orderAmount and orderDiscounts, It also contains the method finalOrderTotal() for calculating the final order amount
The second class CustomerOrder contains the main method and serves as the driver class.
The finalAmount is calculated in the method finalOrderTotal() and the logic here substracting the discount from the orderAmount that is orderAmount - (orderAmount * orderDiscount)
Since the orderAmount in the given example is 580 and the discount is 0.1 (i.e 58) the finalAmount will be 580 - 58 which gives 522 dollars