Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Re: Operator % cannot be applied to java.lang.String,int?

    What does your program do if you enter invalid data?
  2. Re: Operator % cannot be applied to java.lang.String,int?

    First you must define what values are invalid.
    Then you can write code to detect them.
  3. Re: Operator % cannot be applied to java.lang.String,int?

    Try it and see what happens:
    System.out.println("valueOf123=" + Integer.valueOf("123"));
  4. Re: Operator % cannot be applied to java.lang.String,int?

    What are you trying to do with a String and the % operator?

    What would the results of "hi there" % 4 be?
    It makes no sense.

    If the String contains numeric digits: "123" then use an Integer...
Results 1 to 4 of 4