Search:

Type: Posts; User: newbie

Search: Search took 0.14 seconds.

  1. Replies
    9
    Views
    1,877

    Re: I cannot get boolean to work properly

    When ever you print out your object directly, you will most likely always need to define the method yourself so that you get the output required for your program.

    When you try and print out an...
  2. Replies
    9
    Views
    1,877

    Re: I cannot get boolean to work properly

    Whenever an attempt to print an object is made, it automatically calls its toString method, which will print in a format you do not want, with numbers and @ etc. So by overriding toString, it means...
  3. Replies
    9
    Views
    1,877

    Re: I cannot get boolean to work properly

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    package plantnursery;
    import java.util.Scanner;
    /**
    *
    * @author Kl2eativ
  4. Replies
    9
    Views
    1,877

    Re: I cannot get boolean to work properly

    No as fragile is a boolean variable.
    I assumed you had more code that what you posted,
    ie. you have " heightInFeet" in your code which isn't declared anywhere in what you posted.
  5. Replies
    9
    Views
    1,877

    Re: I cannot get boolean to work properly

    Reason you get error would be because the inputs you provide aren't "true" or "false".
    as you state nextBoolean(), the only correct inputs would be "true" or "false", where "yes","no","maybe" aren't...
Results 1 to 5 of 5