Search:

Type: Posts; User: maple1100

Search: Search took 0.09 seconds.

  1. Replies
    9
    Views
    1,401

    Re: Java int comparison

    Thanks you for clearing that up! Could you give me a hint of which part of the program should I assign what it read so it can be use in the else statement? Thanks
  2. Replies
    9
    Views
    1,401

    Re: Java int comparison

    What data type should I read the user input into? If I use Int, it would give me an error when user input a double.
  3. Replies
    9
    Views
    1,401

    Re: Java int comparison

    " "Please enter the fibonacci number "- I mean at "What integer would you like to calculate the Fibonacci number for? " - Sorry.

    else if(userNum.nextInt() < 0 ) - This is use to compare if the...
  4. Replies
    9
    Views
    1,401

    Re: Java int comparison

    I just realize I use the int variable instead of the scanner in the if statement. Thanks you.

    --- Update ---

    I'm sorry, I marked the thread by accident. Here is what I have so far. Right now,...
  5. Replies
    9
    Views
    1,401

    Java int comparison

    I'm trying to see if the user input is an int but the error I'm getting is int cannot be a deference could someone explain to me what does that mean? Thanks


    import java.util.Scanner;

    public...
Results 1 to 5 of 5