Problem:
Question- Use while loop to write a Java program to calculate the sum of all numbers from 1 to a given positive number inclusive. Name the class as Sum, declare a field as sum, initialize sum in the constructor, and name the method as sumOfNumbers. Display the result as string.
Show the code, demonstrate it works properly and describe what it is doing.