Monday, 25 April 2016

Magic Numbers in Java


Magic number
 is a numeric literal that is not defined as a constant.

Non magic numbers 
By default, -1, 0, 1, and 2 are not considered to be magic numbers.

Using magic numbers is a bad practice in java and you should use constant variable instead of magic numbers.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.