title: Getting issue in adding data to List
body: <p>I have two classes namely Test and Demo and in Demo class I have a class variable namely List. I somehow need to put/add the given two strings into List but it will only accept objects of Test class. Is there a way I can add the given strings to List.</p>
  
  <pre><code>class Test{
  
  List&lt;Test&gt; getdataFromDemo(){
     return Demo.getData;
    }
  }
  
  class Demo{
  
  public static List&lt;Test&gt; getData=new LinkedList&lt;Test&gt;;
  
  static void D1(){
  String str1="TestOne";
  String str2="TestTwo";
  }
  
  getData.add(str1);//need to add str to getData but this is showing error
  getData.add(str2);
  System.out.println(getData)
  </code></pre>