Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Re: setting a boolean in a field when being read from a file

    The code:

    airCon = yes.equals("yes");
    The Strings that were read:
    yes=Yes<
    yes=Yes<

    Notice the difference of case in the spelling: Y is not equal to y
    The String class has a method for...
  2. Re: setting a boolean in a field when being read from a file

    Can you copy and paste here what is printed out?
  3. Re: setting a boolean in a field when being read from a file

    Does that code work? What is printed out?
    Change the println to:

    System.out.println("yes="+yes +"<");
    to see what was read and tested.
  4. Re: setting a boolean in a field when being read from a file

    Did it work as you wanted?

    Please post the current version of the code.
  5. Re: setting a boolean in a field when being read from a file

    Are you using the code shown in post#1 to set the boolean?
  6. Re: setting a boolean in a field when being read from a file

    Read the String into a variable and print out the value of that variable to be sure that it contains the String that you think it should.
  7. Re: setting a boolean in a field when being read from a file

    What happens when you compile and execute the code?
  8. Re: setting a boolean in a field when being read from a file

    What happens when you compile and execute the code?

    Please edit your post and wrap your code with


    <YOUR CODE HERE>

    to get highlighting and preserve formatting.
Results 1 to 8 of 8