• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating list that contains elements on class  RSS feed

 
Jukka Kuusamo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should create list that contains elements on class.

I create class


and list


but I can't add on list anything except null.

How could I define myString when I add things to list?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jukka Kuusamo wrote:but I can't add on list anything except null.

Why not? What did you try and what error message are you getting? If you declare your list like that, you should be able to add MyClass objects to it:


 
Jukka Kuusamo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!