title: How to use two objects of the same class during a method call?
body: <p>I'm new to java, and having trouble getting the right syntax for my code, which I've simplified here;</p>
  
  <pre><code>public class Words {
  
     private int num;
  
     public Words(Int identifier) {
        this.num = identifier;
  
     public boolean isSimilar(Object object) {
        Words similar = (Words) object;
        //pretend there's a getIdentifier method in the class
        if (this.num == similar.getIdentifier + 1 || this.num == 
             similar.getIdentifier - 1) {
           return true
        }
        return false;
  
     public String sameSame(){
        // if the two objects return true for isSimilar(), return true here
        return null;
  </code></pre>
  
  <p>I'm having trouble righting the correct syntax for <code>sameSame()</code>. If I have two objects created in a main loop like this</p>
  
  <pre><code>Words word1 = new Words(5);
  Words word2 = new Words(6);
  
  word.sameSame()
  </code></pre>
  
  <p>how do I correctly word <code>sameSame()</code>? I imagine something like this:</p>
  
  <pre><code>public String sameSame(){
     if (word1.isSimiilar(word2)){
        System.out.println("Yeah they're same same");
     System.out.println("Not same same");
  </code></pre>
  
  <p>Basically, how can I use both objects but with a method that doesn't take any arguments?</p>
  
  <p>I hope that makes sense.</p>
  
  <p>Cheers. </p>