title: intersection of two given LinkedList
body: <p><strong>Find the intersection of two given LinkedList (where each node has a character). 
  Return the LinkedList which has character which appears in both LinkedList (same sequence order as LinkedList1).</strong>  </p>
  
  <p>error:<em>variable temp might not have been initialized</em></p>
  
  <p>I tried a lot to resolve this error, but I cant step forward in this problem. Please help to resolve my error.</p>
  
  <pre><code>public SchNode func(SchNode head1, SchNode head2)
      {
          SchNode temp;
  
      for(SchNode ptr=head1;ptr!=null;ptr=ptr.nextNode)
      {
          for(SchNode ptr2=head2;ptr2!=null;ptr2=ptr2.nextNode)
          {
              if(ptr.ch==ptr2.ch)
              {
             temp.ch=ptr2.ch;
             temp=temp.nextNode;
  
              }
          }
      }
  
      return temp ;
      }
  </code></pre>