What number of bottles?
There is no error. It's just the wrong code.
Type: Posts; User: tai8
What number of bottles?
There is no error. It's just the wrong code.
Oh ok. Um I just need the output to say:
Ninety Nine bottles of beer on the wall,
Ninety Nine bottles of beer,
Take one down, pass it around,
Ninety eight bottles of beer on the wall.
...
Thank you. Better now?
That's the problem I don't know. I'm new to this forum and I'm not sure how to do it. So you just want me to quote my code I'm guessing?
Ok I tried something completely different. This is my completely different code.
public class BottleSong {
private int bottles =99;
public BottleSong(int n)
{
bottles = n;
}
I thought I already did do that. How do I create an instance of the class and call one of its methods?
So am I supposed to just add this: "System.out.println("\nTake one down, pass it around\n");" after the public static void main(String[] args) { ? I did and when I ran it it outputted Take one down,...
How do I do that? I'm sorry for asking these questions, I'm a beginner with this and really don't know...
So no one knows? I'm not sure why it isn't running...
So you're saying I should remove that statement? I did and when I ran it I got nothing. Is the code supposed to be working?
Ok is this readable now?
Basically the only problem I have is the line that says, "new BottleSong(Integer.parseInt(args[0])).pr… ". It's saying illegal character: \8230 and that it's not a...
Can anyone please help me?
How do I do that? I don't see what the problem is. I copied and pasted everything from my IDE to here. I'm using NetBeans if that matters.
For the public static void main thing it says "illegal static declaration in inner class assignment.pkg4.pkg1.Assignment41.BottleSong. Modifier 'static' is only allowed in constant variable...
Ok this is what I have so far.
The problem lies in the last 3 lines. Where I wrote "here" that's where the red question mark pops up indicating an error. Also, when I try to run it why does it...
Hello, I am trying to write a program that would output the song "ninety nine bottles of beer on the wall" but for some reason this code isn't working. These are the directions.
Write a...