How to call an entire class from another class in Java?
<p>I am a beginner in Java. I have two packages in my current project. Each of the packages have two classes called the "packageClassOne" and "packageClassTwo".</p>

<p>The packageClassTwo has a constructor and other public methods.</p>

<p>I want to call the PackageClassTwo from an if statment located in the PackageClassOne. My code looks something like this</p>

<p>packageClassOne:</p>

<pre><code> public class packageClassOne {
    public void selectComponent(boolen) {
       if(/* check condition*) {
          packageClassTwo value = new packageClassTwo();
       }
    }
 }
</code></pre>

<p>packageClassTwo:</p>

<pre><code> public class packageClassTwo {

    public packageClassTwo(String name){     //Constructor
         int length = name.length();
     }

   public String CreateWord(){
      /*functionality ofthis method*/
   }

    public String CreateSentence(){
      /*functionality ofthis method*/
   }
 }  
</code></pre>

<p>The problem is that everytime I call the packageClassTwo from my packageClassOne it tries to call the constructor instead of calling the class itself. I want to call the entire packageClassTwo instead of just the constructor. </p>

<p>Can somebody help me please? Thank you in advance for your help</p>