Question: Write a public Java class called MultiplyDigits which has a public method called calculate that returns the product of all digits of the input number.

Write a public Java class called MultiplyDigits which has a public method called calculate that returns the product of all digits of the input number. For example, if the number is 259, then the product returned will be 2*5*9 = 90. Test your method by calling it in the main method with 742 as the input number.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!