File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Assertions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Assertions" Watch "Assertions" New topic


Puja Sinha

Joined: May 25, 2011
Posts: 27

Why should we not use assertions to validate arguments to a public method ?

Shaikh Ali
Ranch Hand

Joined: Jan 26, 2011
Posts: 51
Please refer to this link for an explanation.
Puja Sinha

Joined: May 25, 2011
Posts: 27
Thanks Faraz. So when we say nonpublic methods can use assertions to test the method arguments, do we include the protected methods in it as well ?
I agree. Here's the link:
subject: Assertions
It's not a secret anymore!