It's not a secret anymore!
The moose likes Beginning Java and the fly likes assertion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "assertion" Watch "assertion" New topic


akila sekaran
Ranch Hand

Joined: Jun 12, 2012
Posts: 48
can assertion be done at compile time ?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

No. Assertions are used for example to check if the values that you pass to a method are within the range that the method expects. It makes to sense to "do assertions at compile time".

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: assertion
It's not a secret anymore!