GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Each time a method is invoked, the system stores parameters…

Each time a method is invoked, the system stores parameters and local variables in an area of memory, known as ________, which stores elements in last-in first-out fashion.

Read Details

What is the value in count after the following loop is execu…

What is the value in count after the following loop is executed?int count = 0;do { System.out.println(“Welcome to Java”);} while (count++ < 9);System.out.println(count);

Read Details

What will be displayed when the following code is executed?i…

What will be displayed when the following code is executed?int number = 6;while (number > 0) { number -= 3; System.out.print(number + ” “);}

Read Details

Which pattern is produced by the following code?for (int i =…

Which pattern is produced by the following code?for (int i = 1; i = 1; j–) System.out.print(j

Read Details

Given the following method, what is the output of the call n…

Given the following method, what is the output of the call nPrint(‘a’, 4)?static void nPrint(String message, int n) { while (n > 0) { System.out.print(message); n–; }}

Read Details

What is sum after the following loop terminates?int sum = 0;…

What is sum after the following loop terminates?int sum = 0;int item = 0;do { item++; if (sum >= 4) continue; sum += item;}while (item < 5);

Read Details

Suppose s is a string with the value “java”. What will be as…

Suppose s is a string with the value “java”. What will be assigned to x if you execute the following code?char x = s.charAt(4);

Read Details

How many times is the println statement executed?for (int i…

How many times is the println statement executed?for (int i = 0; i < 10; i++) for (int j = 0; j < i; j++) System.out.println(i * j)

Read Details

The statement System.out.printf(“%3.1f”, 1234.56) outputs __…

The statement System.out.printf(“%3.1f”, 1234.56) outputs ________.

Read Details

In the following code, what is the output for list2?public c…

In the following code, what is the output for list2?public class Test { public static void main(String[] args) { int[] list1 = {1, 2, 3}; int[] list2 = {1, 2, 3}; list2 = list1; list1[0] = 0; list1[1] = 1; list2[2] = 2; for (int i = 0; i < list2.length; i++) System.out.print(list2[i] + " "); }}

Read Details

Posts pagination

Newer posts 1 … 37,324 37,325 37,326 37,327 37,328 … 74,725 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top