GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Consider the following code snippet. Which statement should…

Consider the following code snippet. Which statement should be used to fill in the empty line so that the output will be [32, 54, 67.5, 29, 35]? public static void main(String[] args) { double data[] = {32, 54, 67.5, 29, 35}; ______________ System.out.println(str); }

Read Details

The black boxes from which a program is manufactured are cal…

The black boxes from which a program is manufactured are called ___.

Read Details

What is the output of the following code snippet? int i = 1;…

What is the output of the following code snippet? int i = 1; while (i < 20) { System.out.print(i + " "); i = i + 2; if (i == 15) { i = 19; } }

Read Details

Assume the array of integers values has been created and pro…

Assume the array of integers values has been created and process is a method that has a single integer parameter. Which of the following is equivalent to the loop below? for (int val: values) { process(val); }

Read Details

What changes do you need to make in the following code snipp…

What changes do you need to make in the following code snippet to display “Let us learn Java” exactly 10 times? int i = 0; while (i

Read Details

What are the values of i and j after the following code snip…

What are the values of i and j after the following code snippet is run? int i = 10; int j = 20; int count = 0; while (count < 5) { i = 2*i; i = i + 1; j = j - 1; count++; } System.out.println("i = " + i + ", j = " + j);

Read Details

Suppose you wish to write a method that returns the sum of t…

Suppose you wish to write a method that returns the sum of the elements in partially filled array. Which is the best choice for a method header?

Read Details

Which of the following loops executes 8 times?

Which of the following loops executes 8 times?

Read Details

Which of the following statements is true about the if state…

Which of the following statements is true about the if statement?

Read Details

What is the output of the code snippet given below? String s…

What is the output of the code snippet given below? String s = “abcde”; int i = 1; while (i < 5) { System.out.print(s.substring(i, i + 1)); i++; }

Read Details

Posts pagination

Newer posts 1 … 51,076 51,077 51,078 51,079 51,080 … 58,782 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top