-3
    public void run(){
            while (running){
                System.out.println("RAWR");
                }
    }

I am learning java through watching a person on youtube and for some reason I cannot get this part to work please look over and help solve if need more of the code leave a msg.

1 Answers1

0

I can assume that 'running' is false.

In java, while/if(variable) will infer that you mean while/if(varible == true)

Also, please add more context and more information in future (More code is a good start). Maybe, give us your thoughts on why or what you have done to trouble shoot as well as what you are trying to achieve. This way, people will be more inclined to reply due to you showing that you have put effort in.

public class Run{

     public static void main(String []args){
        new Run().run();
     }

        public void run(){
            boolean running = true;
            while (running){
                System.out.println("RAWR");
                running = false;
                }
    }
}
user2469515
  • 373
  • 3
  • 12