0

programming languages Online Quiz - 252

Description: programming languages Online Quiz - 252
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

If a constructor uses super, it must use it in the first line; otherwise, the compiler will complain.

  1. True

  2. False


Correct Option: A
  1. "X extends Y" is correct if and only if X is a class and Y is an interface

  2. "X extends Y" is correct if and only if X and Y are either both classes or both interfaces

  3. "X extends Y" is correct if and only if X is an interface and Y is a class

  4. None of these


Correct Option: B

A local variable with the same name as an instance variable

  1. shadowing

  2. Coupling

  3. Cohesion

  4. None of the above


Correct Option: A
  1. Interface can extend one or more interfaces

  2. Interface can extend one or more class

  3. Interface cannot implement a class or interface

  4. All of the above


Correct Option: A
  1. Cohesionn is the OO principle most closely associated with hiding implementation details

  2. Cohesion is the OO principle most closely associated with making sure that classes know about other classes only through their APIs

  3. None of these

  4. Cohesion is the OO principle most closely associated with making sure that a class is designed witha single well focussed principle


Correct Option: D

Look at the code below and select the correct answer:#include main(){printf ("hello world");}

  1. Will not compile

  2. Will compile without error but not run

  3. Will compile with warnings but run ok

  4. Will compile with warnings, but not run


Correct Option: C

See the code below and select the correct answer: #include #include #include main() { clrscr(); int i; printf ("enter integer: "); scanf ("%d",&i); printf ("You have entered: %d ", i); getch(); return (0); }

  1. Will not compile

  2. Will compile with warning, and run

  3. Will compile but not run

  4. Will provide an output 1


Correct Option: A

The output of the above code is 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

  1. True

  2. False


Correct Option: A

Code: #include #include #include main() { int i=0, j=0; clrscr(); for (i=0; i<=5;i++) { for (j=0; j

  1. True

  2. False


Correct Option: A

Note the following code and then select the correct answer: #include main() { int i; printf ("enter integer: "); scanf ("%d",&i); printf ("You have entered: %f ", i); return (0); }

  1. Will not compile

  2. Will compile with warnings, but run

  3. Will compile without warning, but not run

  4. Will give an output of 1


Correct Option: C

Note the code below and select the correct answer: #include main() { printf ("hello world"); }

  1. Will not compile

  2. Will compile without error or warning and run ok

  3. Will compile without error or warning but not run

  4. Will compile with warning but run ok


Correct Option: D

static methods cannot be overridden to non-static methods.

  1. True

  2. False


Correct Option: A

we can not override a synchronized method as non-synchronized method.

  1. True

  2. False


Correct Option: B
- Hide questions