Question: How many times would hello print when the following code executes? public class printHello { public static void main(String[] args) { int counter =

How many times would "hello" print when the following code executes? public 

How many times would "hello" print when the following code executes? public class printHello { public static void main(String[] args) { int counter = 0; while(counter < 10) { } } System.out.println("hello"); counter += 2; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class PrintHello public static void mainString args int counter 0 while counter 10 Systemoutp... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!