Tag: programming languages

Questions Related to programming languages

Multiple choice technology programming languages
  1. With assertions enabled it prints 210210-1 followed by an AssertionError message.

  2. With assertions enabled it prints 210210 followed by an AssertionError message.

  3. With assertions enabled it prints only 210210

  4. With assertions enabled it prints nothing.

  5. With assertions disabled it prints 210210-1

  6. With assertions disabled it prints only 210210

Reveal answer Fill a bubble to check yourself
B,E Correct answer
Multiple choice technology programming languages
  1. With assertions enabled it prints ABC followed by an AssertionError message.

  2. With assertions disabled it prints ABC followed by an AssertionError message.

  3. Assertions should not be used within the default case of a switch statement.

  4. In this code example a throw statement must be used in place of the assert statement.

  5. Compile-time error

Reveal answer Fill a bubble to check yourself
D,E Correct answer
Multiple choice technology programming languages
  1. If assertions are not enabled at run time it prints an error message.

  2. If assertions are not enabled at run time it prints nothing.

  3. With assertions enabled it prints an error message.

  4. With assertions enabled it prints nothing.

  5. The assert statement is being used to check a class invariant--something that must be true about each instance of the class

  6. The assert statements are being used to check a precondition--something that must be true when the method is invoked.

Reveal answer Fill a bubble to check yourself
B,D,E Correct answer
Multiple choice technology programming languages
  1. would match any three-character string starting with "a" and ending with "z" whose second character was not a space, tab or newline.

  2. the second character could be a letter, number or symbol

  3. would match any three-character string starting with "a" and ending with "z" whose second character was a newline

  4. None of the above

Reveal answer Fill a bubble to check yourself
A,B Correct answer
Multiple choice technology programming languages
  1. p is a function that accepts an argument which is a pointer to a character and returns a pointer to a 10 element integer array

  2. p is a pointer to a function that accepts an argument which is a pointer to a character and returns an integer quantity

  3. p is a function that accepts an argument which is a pointer to a character and returns an integer quantity

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Multiple choice technology programming languages
  1. p is a function that accepts an argument which is a pointer to a character and returns an integer quantity

  2. p is a function that accepts an argument which is a pointer to a character and returns a pointer to an integer quantity

  3. p is a function that returns a pointer to an integer quantity

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer