Search:

Type: Posts; User: Norm

Search: Search took 0.08 seconds.

  1. Replies
    3
    Views
    1,268

    Re: Program crashes when user input's decimals

    The compiler is saying that if you assign a double like 9.5 to an int variable you will lose the 0.5 part because the int variable will hold 9.
    If that is what you want to happen, then use a cast to...
  2. Replies
    3
    Views
    1,268

    Re: Program crashes when user input's decimals

    Look at the Double class for a method to parse decimal numbers. The Integer class's parseInt() method is for integer/whole numbers (digits only)
Results 1 to 2 of 2