0

programming languages Online Quiz - 290

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

Which of the following activities is used in a BPEL process to assign manual tasks to users?

  1. Compensate

  2. Throw

  3. Human Task

  4. Catch

  5. Pager


Correct Option: C

Which application is used by users to browse and act on tasks assigned to them from a BPEL process?

  1. Identity Service

  2. Task Serice

  3. Worklist Application

  4. Human Task Application


Correct Option: C

Which of the following BPEL functions can be used to read the contents of a BPEL variable?

  1. getVariableData

  2. getContentAsString

  3. getElement

  4. getVariableProperty


Correct Option: A

Which built-in XPATH function is used to know the run-time size of a data sequence?

  1. getCount

  2. . count

  3. generateGUID

  4. num


Correct Option: B

If the portType element in the WSDL file of a BPEL process contains both input and output elements, what can be gauged about the nature of the BPEL process

  1. The BPEL process is synchronous in nature

  2. The BPEL process is asynchronous in nature

  3. The BPEL process has parallel processing

  4. We do not have sufficient information to tell whether the BPEL process is synchronous or asynchronous


Correct Option: A

How many portType elements are typically present in the WSDL file of an asynchronous BPEL process?

  1. 1

  2. 2

  3. 3

  4. 4


Correct Option: B

Which of the following activities is used to write java code in a BPEL process?

  1. Java Embedding

  2. Wrapper

  3. Transform

  4. None of these


Correct Option: A

Which of the following statements are true about BPEL fault handling?

  1. BPEL code which can generate faults should be placed within a try-catch block

  2. BPEL code which can generate faults should be placed within a catch block

  3. Several catch blocks can be added to the same BPEL scope

  4. The CatchAll block cannot be used if a catch block is used in a scope


Correct Option: B,C

A scope within a BPEL process has a catch block for Remote Fault and a catch block for Binding Fault followed by a catchAll block in that order. Which of the following statements are true?

  1. . If a Remote Fault occurs, it will be caught by the catchAll block

  2. . If a Binding Fault occurs, it will be caught by the catchAll block

  3. . If a Remote Fault occurs, it will be caught first by the Remote Fault catch block and then by the catchAll block

  4. . All faults will always be caught by the catchAll block

  5. None of the above


Correct Option: E

int *p[10]

  1. p is a pointer to a 10 element integer array

  2. p is a 10-element array of pointers to integer quantity

  3. p is a pointer to an integer quantity

  4. None of the above


Correct Option: B
  1. p is a pointer to pointer to integer

  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. p is a function that accepts an argument which is a pointer to a character and returns a pointer to an integer quantity


Correct Option: C

int (*p)[10]

  1. p is a pointer to a 10 element integer array

  2. p is a pointer to an integer quantity

  3. p is a 10-element array of pointers to an integer

  4. None of the above


Correct Option: A

What gets displayed on the screen when the following program is compiled and run. Select the one correct answer. protected class example { public static void main(String args[]) { String test = "abc"; test = test + test; System.out.println(test); } }

  1. The class does not compile because the top level class cannot be protected.

  2. The program prints "abc"

  3. The program prints "abcabc"

  4. The program does not compile because statement "test = test + test" is illegal.


Correct Option: A

Which of the following are true. Select the three correct answers.

  1. A static method may be invoked before even a single instance of the class is constructed.

  2. A static method cannot access non-static methods of the class.

  3. Abstract modifier can appear before a class or a method but not before a variable.

  4. final modifier can appear before a class or a variable but not before a method.

  5. Synchronized modifier may appear before a method or a variable but not before a class.


Correct Option: A,B,C

What is the result of evaluating the expression 14 ^ 23. Select the one correct answer.

  1. 25

  2. 37

  3. 6

  4. -9

  5. 23


Correct Option: A

Which of the following statements related to Garbage Collection are correct. Select the two correct answers.

  1. It is possible for a program to free memory at a given time.

  2. Garbage Collection feature of Java ensures that the program never runs out of memory.

  3. It is possible for a program to make an object available for Garbage Collection.

  4. The finalize method of an object is invoked before garbage collection is performed on the object.


Correct Option: C,D

AI Explanation

To answer this question, you need to understand the concept of Garbage Collection. Let's go through each option to understand why it is correct or incorrect:

Option A) It is possible for a program to free memory at a given time.

  • This option is incorrect because in most programming languages with garbage collection, the program does not have direct control over when memory is freed. The garbage collector automatically determines when objects are no longer in use and frees the memory occupied by those objects.

Option B) Garbage Collection feature of Java ensures that the program never runs out of memory.

  • This option is incorrect. While garbage collection helps manage memory, it does not guarantee that a program will never run out of memory. If a program is creating objects faster than the garbage collector can collect them, it can still run out of memory.

Option C) It is possible for a program to make an object available for Garbage Collection.

  • This option is correct. In languages with garbage collection, a program can make an object available for garbage collection by removing all references to that object. Once there are no more references to an object, it becomes eligible for garbage collection.

Option D) The finalize method of an object is invoked before garbage collection is performed on the object.

  • This option is correct. In some programming languages (such as Java), the finalize method of an object is called before the garbage collector collects and frees the memory occupied by the object. The finalize method allows an object to perform any necessary cleanup actions before it is removed from memory.

The correct answers are C and D. These options are correct because a program can make an object available for garbage collection by removing all references to it, and the finalize method is invoked before garbage collection is performed on an object.

class MCZ27 { public static void main (String[] args) { char a = '\f'; // 1 char b = '\n'; // 2 char c = '\r'; // 3 char d = '\l'; // 4 char e = '\'; // 5 }} A compile-time error is generated at which line?

  1. 1

  2. 2

  3. 3

  4. 4

  5. 5

  6. No errors


Correct Option: D

class JJF3 { public static void main(String args[]) { System.out.print(Integer.toBinaryString(Byte.MAX_VALUE)+","); System.out.print(Integer.toOctalString(Byte.MAX_VALUE)+","); System.out.print(Integer.toString(Byte.MAX_VALUE)+","); System.out.print(Integer.toHexString(Byte.MAX_VALUE)); }}

  1. Prints: 1111111,177,127,7f

  2. Prints: 11111111,377,256,ff

  3. Compile-time error

  4. Run-time error

  5. None of the above


Correct Option: A

class JJF4 { public static void main(String args[]) { System.out.print(Long.toHexString(Byte.MAX_VALUE)+","); System.out.print(Long.toHexString(Character.MAX_VALUE)+","); System.out.print(Long.toHexString(Short.MAX_VALUE)); }}

  1. Prints: f,ff,7f

  2. Prints: f,ff,ff

  3. Prints: 7f,ffff,7fff

  4. Prints: ff,ffff,ffff

  5. Prints: 7fff,ffffff,7fffff

  6. Prints: ffff,ffffff,ffffff


Correct Option: C
- Hide questions