• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assertions

 
Siva Sivaraman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to assertions.In the following code, how is it possible for the constructor C to access validateC()?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ummm... because you called validateC() from the constructor? It's always possible to access a class method from within a constructor - why not? (There may be complications if the method is later overridden, but that's not possible here since it's private.) I'm not sure what you're asking.
 
Siva Sivaraman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This was the answer, I was looking for

It's always possible to access a class method from within a constructor

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic