GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Which statement generates random numbers in the range from 1…

Which statement generates random numbers in the range from 10 to 50?

Read Details

What will be printed after the following statements are exec…

What will be printed after the following statements are executed? int length;length = 11; // 11length *= 3; length *= length;length /= 50;System.out.println(length); If it shows an error, just type error.

Read Details

Consider the following code segment.       int a = 10;    in…

Consider the following code segment.       int a = 10;    int b = 5;    if(a + b > 10) {        System.out.print(a + b);    }    if(a – b > 0) {         System.out.print(a – b);    }   What, if anything, is printed as a result of executing the code segment?

Read Details

What would be the output of the following code? int input =…

What would be the output of the following code? int input = 5;int output = 3;input++;output += input;System.out.println(output);

Read Details

Consider the following code segment.   double sum = 0.0;for…

Consider the following code segment.   double sum = 0.0;for (int outer = 1; outer

Read Details

Assuming the following declarations:  int x = 5, y = 2, z =…

Assuming the following declarations:  int x = 5, y = 2, z = 10, temp = 0; What is the output of the following statement? If it causes an error, just type error. If nothing is output, just type no output. if ( x + y > z ) {     x = y + z; } else {     x = y – z;    }System.out.println( x + ” ” + y + ” ” +  z );

Read Details

Consider the following method. public double oneMethod(int a…

Consider the following method. public double oneMethod(int a, boolean b) {            /* implementation not shown */  } Which of the following lines of code, if located in a method in the same class as oneMethod, will compile without error?

Read Details

Consider the following code segment. int x = 3;int y = -1;if…

Consider the following code segment. int x = 3;int y = -1;if (x – 2 > y){ x -= y;}if (y + 3 >= x){ y += x;}System.out.print(“x = ” + x + ” y = ” + y); What is printed as a result of the execution of the code segment?

Read Details

What is the output of the following code fragment? Assume al…

What is the output of the following code fragment? Assume all the variables are declared.   if(( 5.2 > 3.3 && 6.2 < 9.9) && (6.2 < 3.5 || 4.2 == 3.1 || 3.1 != 3.14)) {       System.out.print("TRUE");}else {     System.out.print("FALSE");}

Read Details

Consider the following code segment. System.out.print(“*”);…

Consider the following code segment. System.out.print(“*”);System.out.println(“**”);System.out.println(“***”);System.out.print(“****”); What is printed as a result of executing the code segment?

Read Details

Posts pagination

Newer posts 1 … 70 71 72 73 74 … 86,459 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top