title: Writing a pattern in java
body: <p>2- (Display patterns) Write a method to display a pattern as follows:</p>
  
  <pre><code>1
  2 1
  3 2 1
  …
  n n-1 … 3 2 1
  </code></pre>
  
  <p>The method signature is <code>public static void displayPattern(int n)</code>. the user enters number for how long they want the pattern to be. </p>
  
  <p>I know how to set it up but don't know what code to use inside the method. This is how far I got-</p>
  
  <pre><code>    Scanner input=new Scanner(System.in);
      System.out.println("Please enter the num for how long the pattern is");
      int n= input.nextInt();
  
  }
  public static void TheNum(int n){
  
  
  
  
  
  
  }
  </code></pre>