Question: Write a Java program to create a package named Pack1, with a class Extract. Create another package Pack2 inside Pack1 with two classes Sum and
Write a Java program to create a package named Pack1, with a class Extract. Create another package Pack2 inside Pack1 with two classes Sum and SumOfSquares in it. a. In the Extract class, define a method extractDigits() that will extract the digits of a number passed to it and store the extracted digits in an array. b. In the Sum class, define a method printSum() to find the sum of the elements of the array stored in Extract class. c. In the SumOfSquares class, define a method printSumofSquares() to find the sum of the squares of the array elements d. Define the main class and import the packages and call the methods under the classes Extract, Sum, SumOfSquares respectively.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
