title: Deleting a specific node in a singly linked list(java)
body: <p>So my problem is that I wanna delete a node based on a value inputted by the user, in my program I can already, add, search, and delete the node in the last position, but so far I haven't been able to delete a specific value inputted by the user, if for example I have 1,2,3,4 elements in my list I wanna be able to point at, say 2, and delete it. here are my functions, the last one is the uncompleted one: </p>
  
  <pre><code>//searches node
  public void searchNode(int input){
      Node temp = first;
      boolean found = false;
  
      if(!isEmpty()){
          for(int i = 0 ; i&lt;size ; i ++){
            if(temp.value == input){
               System.out.println(input + " found in the position: " + (i+1));
               found = true;
               break;
              }
              temp = temp.rightNode;
          }
      if(!found)
          System.out.println("value not found.");
          }
      }
  
  //deletes last node
  public void deleteLastNode(){
      if(isEmpty()){
         System.out.println("There are no nodes to delete.");
      }
  
      if(last == first){
         first = null;
         last = null;
      } else {
         Node current = first;
         while(current.rightNode != last){
         current = current.rightNode;
      }
         current.rightNode = null;
         last = current;
      }
   size --;
  }
  
  
  //delete element, input by user.
  public void deleteInputByUser(int input) {
     Node temp = first;
     boolean found = false;
  
     if(isEmpty()){
         System.out.println("There are no nodes to delete.");
     } else {
  
        }
     size--;  
  }
  
  
  //Node class
  public class Node{
  int value;
  Node rigthNode;
  
  public Node(int value){
      this.value = value;
    }
  
  }
  </code></pre>