Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    BottleSong bs = new BottleSong(19); //<<<<<<<<< small number for testing

    There could be an error in your logic. The option will show it.
  2. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    For testing change the number of bottles to 19 and see what is output.

    You need to add the -Xlint option for the compiler to see the possible error.
  3. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    Yes, the formatting is better, but there are Way too many empty lines!!!

    Can you explain what is wrong with the program's output. You've posted two outputs but didn't explain what was wrong with...
  4. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    Edit your post and wrap your code with



    <YOUR CODE HERE>


    to get highlighting
  5. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    Let us know when you have wrapped your code in code tags.
  6. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    Did you skip the first couple of chapters of your textbook?
    Creating an instance and calling a method are very basic concepts.
    Here is a tutorial that you should read:
    Trail: Learning the Java...
  7. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    That shows that your program is running.
    Now if you want it to execute other parts of the program you will have to add code to do that.
    One way is to create an instance of the class that the...
  8. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    Which don't you know?
    add a line of code first thing in the main() method
    printing a message?

    Your code has several statements that print output using println. For example:

    ...
  9. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    What isn't running? Add a call to println to print out a message the first thing in the main() method. If it prints then you will know that the program is running.
  10. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    No, there is no indentation. All the lines start in column 1. Nested code should be indented.
    Please use code tags.

    Where did you get this statement from?


    ...
  11. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    Are you having problems doing this?
    Can you change the tags around your code from quote to code to make your code readable?

    Your code is not readable the way it is posted.
  12. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    Can you change the tags around your code from quote to code to make your code readable?
  13. Replies
    33
    Views
    4,800

    Re: Why isn't this code working?

    Please use code tags, not quote tags.

    Where is the error message text? Can you compile the source with javac and post the error messages from the compiler?
Results 1 to 13 of 13