what is mean by (Baseline) JAVA0076 Use of magic number '6'

Posted on 2011-05-02
Last Modified: 2012-05-11
what is mean by (Baseline) JAVA0076 Use of magic number '6'
    LVL 92

    Accepted Solution

    LVL 92

    Expert Comment

    instead of using values (6) in your code, define a constant and use that
    theres an example in the link above
    LVL 20

    Author Comment

    by:Sathish David Kumar N
    >>>>>>However, because small integers are common, this rule does not apply to -5 thru 5.

    why its not apply for thoes range?
    LVL 23

    Assisted Solution

    >> why its not apply for thoes range

    it is up to the programmer.

    In general, magic number refers to use of numbers directly in source code.

    Check out this..
    LVL 92

    Expert Comment

    > why its not apply for thoes range?

    because small numbers are used in a lot of places where you don't need to create constansts for them


    for (int i=0; i<100; i+=2) {

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    countClumps  challenge 10 70
    dividesSelf challange 15 61
    Performance issue while iterating with streams 5 34
    array11 challenge 16 40
    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now