Question: // what is the output? public class Q { public static void main(String[] args) { int i = 1; int j = 2; while


// what is the output? public class Q { public static void

// what is the output? public class Q { public static void main(String[] args) { int i = 1; int j = 2; while (i < 5) { i++; } j = j * 2; System.out.println(j);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets trace through the code 1 i starts at 1 and j starts at 2 2 Th... 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!