Define the following method: public static void Series(intn) This method prints
ID: 3611103 • Letter: D
Question
Define the following method:public static void Series(intn)
This method prints on the terminal window the series of n squarenumbers starting from one.
For instance, if n is 5, the series of numbers that isprinted is 1,4, 9, 16, 25; if n is 10, the series of numbersthat is printed is: 1,4,9, 16, 25,36,49, 64, 81, 100
The first 5 square numbers are obtained asfollows:
1*1 2*2 3*3 4*4 5*5
They are printed in the following way:
1 4 9 16 25
In the main() method, call method Series() with the followingvalues:
- 5
-a value of your choice, but biggerthan five