[Solved] Java Array.asList error


Assuming your Article class is like below if not please make proper class,

class Article{
       String id;
       String article;
       String description;
   Article(String id ,String articleName,String description)
   {
      this.id=id;
      this.articleName = articleName;
      this.description = description;
   }
   ........
   //your getter/setters are defined here.

}

Now you should use them in your main class as below,

List<Article> articleList = new ArrayList<Article>(Arrays.asList(
                new Article( "1","Article 01", "Description 01" ),
                new Article( "2","Article 02","Description 02" ),
                new Article("3","Article 03","Description 03" )
                ));

 //this is the correct way of using it.

0

solved Java Array.asList error