title: How to print the vertical and horizontal line of a matrix by given positions in Java?
body: <p>For example we have the matrix:</p>
  
  <pre><code>a b j d e f g k
  l m a o p y e s
  o k v h e l l o
  t h a n k s a m
  </code></pre>
  
  <p>And I have a give position: row[2] col[2] for character v. I want to print the horizontal and vertical lines based on that or any other position I get. </p>
  
  <p>My horizontal line for that specific position should be:</p>
  
  <pre><code>o k q h e l l o
  </code></pre>
  
  <p>And my vertical line:</p>
  
  <pre><code>j a v a
  </code></pre>