How to make a constructor that takes a String and stores the value in a variable?
<p>I'm new to Java and for my assignment I've been asked to create an instance variable of type String called words. Then I must next "Has a constructor which takes a String. This is converted into lower case and stored in words. Use a method from the String API to make the string lower case." Is this how it would be done or is there a different way:</p>

<pre><code>public class WordGroup {
    //Constructor should be converted to lowercase and put values in string variable "words".
    String x;
    String words = new String (x.toLowerCase());


} 
}
</code></pre>

<p>I know it's a simple question but it may also help other beginners like me, thanks.</p>