Write a recursive method called printNumPattern() to output the following number pattern.Given a positive integer as input (Ex:
12), subtract another positive integer (Ex: 3) continuallyuntil 0 or a negative value is reached, and then continually add the second integer until therst integer is again reached. For this lab, do not end output with a newline.
The following is written in Java and prints out the pattern to and from the first num parameter that is passed to the function. Meaning it goes from num1 to 0 and then from 0 to num1 again. It prints all of the values in a single line seperated by a space and a test case was used using the values provided in the question. The output can be seen in the attached picture below.
Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle) and released in 1995 as a core component of Sun Microsystems' Java platform 1995 the answer