GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

What is the output of the statements below? int a = 10; int…

What is the output of the statements below? int a = 10; int b = 20; int count = 0; if (a > 5) { count ++; if (b > 5) { count ++; } } if (a > 10) { count ++; if (b > 10) { count ++; } } System.out.print (count);

Read Details

Assume the method createSomething has been defined as follow…

Assume the method createSomething has been defined as follows: public static int [] createSomething (int start, int size) { int [] result = new int[size]; for (int i = 0; i < result.length; i++) { result[i] = start; start++; } return result; } What is printed by the statement below? System.out.print(Arrays.toString(createSomething(4, 3)));

Read Details

Which one of the following statements displays the output as…

Which one of the following statements displays the output as 54321.00?

Read Details

When hand tracing, drawing a line through the value stored i…

When hand tracing, drawing a line through the value stored in a variable means that the

Read Details

What is the value of the var variable at the end of the give…

What is the value of the var variable at the end of the given code snippet? int var = 30; var = var + 2 / var; var++;

Read Details

Which one of the following statements displays the output as…

Which one of the following statements displays the output as -1.23e+02?

Read Details

Which error type does the “off-by-one” error belong to?

Which error type does the “off-by-one” error belong to?

Read Details

Assuming that a user enters 15 as input, what is the output…

Assuming that a user enters 15 as input, what is the output of the following code snippet? Scanner in = new Scanner(System.in); System.out.print(“Please enter a number: “); int number = in.nextInt(); if (number > 20) { System.out.println(“The number is LARGE!”); } else { System.out.println(“The number is SMALL!”); }

Read Details

Which operator constructs object instances?

Which operator constructs object instances?

Read Details

What values does counter variable i take on when this loop e…

What values does counter variable i take on when this loop executes? for (int i = 20; i >= 2; i = i – 6) { System.out.print(i + “,”); }

Read Details

Posts pagination

Newer posts 1 … 74,876 74,877 74,878 74,879 74,880 … 82,586 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top