The following method is intended to print the number of digi…

The following method is intended to print the number of digits in the parameter num. public int numDigits(int num){ int count = 0; while (/* missing condition */) { count++; num = num / 10; } return count;} Which of the following can be used to replace / * missing condition */ so that the method will work as intended?

Consider the following method. public static void message(in…

Consider the following method. public static void message(int a, int b, int c){ if (a < 10) { if (b < 10) { System.out.print("X"); } System.out.print("Y"); } if (c < 10) { if (b > 10) { System.out.print(“Y”); } else { System.out.print(“Z”); } }} What is printed as a result of the call message (5, 15, 5) ?

Consider the following code segment. if (false && true || fa…

Consider the following code segment. if (false && true || false){ if (false || true && false) { System.out.print(“First”); } else { System.out.print(“Second”); }}if (true || true && false){ System.out.print(“Third”);} What is printed as a result of executing the code segment?