How to store items of a list in class1 on another list in class2 : <p>I have two classes: Tache2new.java and Luncher.java. 
In Tache2new, I use a list named "rules" to store items.</p>

<pre><code>public static void execute(String concept) {
List&lt;Rule&gt; rules = new ArrayList&lt;&gt;();
…
}
</code></pre>

<p>I would like to call this list in the class Luncher and store its items in ALLrules which is a list in Luncher.</p>

<p>To do this, I added getList() method in Tache2new (line 239). And I added in Luncher the lines ending with the comment //$$ (see the capture). But this triggered an error (highlighted in yellow in Luncher): "the local variable rules may not have been initialized".
How to fix this please?
<a href="https://i.stack.imgur.com/nJYT4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nJYT4.png" alt="enter image description here"></a></p>

<hr>

<p><a href="https://i.stack.imgur.com/T1HrI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T1HrI.png" alt="enter image description here"></a></p>
