0
Alien head

programming languages Online Quiz - 326

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

Running thread can't come back to runnable state directly.

  1. True

  2. False


Correct Option: B

If a thread goes to sleep in synchronized block. (Which one is false)

  1. it is still alive

  2. It will release all hold locks

  3. It comes to runnable state after sleep time expired

  4. No other thread can enter into the synchronized.


Correct Option: B

We can synchronize the variable to avoid race conditions.

  1. True

  2. False


Correct Option: B

When you create a thread instance the state will be

  1. Ready

  2. Runnable

  3. New

  4. Waiting


Correct Option: C

What is true

  1. We can invoke run() method directly to start thread

  2. If we call start() method twice, two threads will be created

  3. t.sleep(50) - it will give minimum guarantee of at least 50ms this thread will not run

  4. Thread can be still alive even after the completion of run().


Correct Option: C

Will it run without error: Thread th = new Thread(new Thread());

  1. It will run without error

  2. Runtime Error

  3. Compilation Error

  4. None of all


Correct Option: A

To create a public generic method named "update" that has no return type. In its argument list, the method accepts an argument named "updateValue" which is of the same type as the type parameter - T. Which is a valid declaration?

  1. public T update()

  2. public void update(T updateValue)

  3. void update(T updateValue)

  4. public void update()


Correct Option: B

Which one is the superclass of all generic objects?

  1. >

  2. extends Object>

  3. None of these


Correct Option: B

Identify the type parameter which can be used to use all numeric types in a generic call.

  1. Integer

  2. Float

  3. Number

  4. Double


Correct Option: C

What are the values of NUM1 and NUM2 after executing the following code?

  1. num1= -99999 num2= 999.99

  2. num1= 0 num2= 999.99

  3. num1= -99999 num2= 99999

  4. num1= 0 num2= 99999


Correct Option: A

Which Built-In-Function will you use to achieve the following functionality?

  1. %ABS

  2. %TRIM

  3. %TRIMS

  4. %UNS


Correct Option: A

Which Built-In-Function will you use to achieve the following functionality?

  1. %ABS

  2. %TRIM

  3. %TRIMS

  4. %UNS


Correct Option: A

What are the features of raw types?

  1. Can be used with Generic code

  2. Raw types take Type parameters

  3. Raw types must be cast to appropriate objects at runtime

  4. Type safety


Correct Option: A,C

Which of the following statement(s) explains the difference(s) between the /INCLUDE and /COPY directives?

  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed


Correct Option: C

Which of the following statement(s) explains the difference(s) between the /INCLUDE and /COPY directives?

  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed


Correct Option: C

Which of the following statement(s) explains the difference(s) between the /INCLUDE and /COPY directives?

  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed


Correct Option: C

Which of the following statement(s) explains the difference(s) between the /INCLUDE and /COPY directives?

  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed


Correct Option: C

Which of the following statement(s) explains the difference(s) between the /INCLUDE and /COPY directives?

  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed


Correct Option: C

Which of the following statement(s) explains the difference(s) between the /INCLUDE and /COPY directives?

  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed


Correct Option: C

What are the benefits of generics?

  1. Generic collections accept only Object types

  2. Type errors are caught at compile time

  3. Generics result in readily understandable code

  4. Generics sometimes require type casting


Correct Option: B,C,D
+ View questions