Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Display error on Java Prime number range

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Display error on Java Prime number range

    1
    Last edited by Buckeye1; October 20th, 2019 at 03:51 PM.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Display error on Java Prime number range

    How does the code start testing with the value in number1?
    What values are in the variables: count and number? How are they used?
    Add some comments to the code describing what they do.

    Note the variable names should describe what values they contain. number1 and number2 do not describe their contents. Better names would be startNumber and endNumber.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. how to fined prime number using arraylist in java
    By sharma605 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 18th, 2013, 10:26 AM
  2. Write a java program to display the prime numbe 1 to 100?
    By jivanvirginiausa in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 31st, 2013, 01:18 PM
  3. display all prime factors of a number
    By mia_tech in forum What's Wrong With My Code?
    Replies: 5
    Last Post: May 18th, 2012, 06:55 PM
  4. Display prime numbers from 100 to 200 in Java
    By c.P.u1 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: January 25th, 2011, 03:14 PM
  5. [SOLVED] Prime number generator program in Java
    By big_c in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 27th, 2009, 12:08 PM