Bookmark Topic Watch Topic
  • New Topic

Constructor not being called  RSS feed

 
Ninja Proctor
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator


Nothing is printed. Why the constructor is not being called?
 
Vasilis Karas
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Report post to moderator
All you've done is create on Array of Test Objects. You haven't actually created any test objects.
You're array has room for four objects of type Test, which it conveniently assigns the value of null.

Now you need to do something like:

 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't crosspost. Continue discussion here: http://www.coderanch.com/t/400209/java/java/Constructor-not-called
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!