Multiple Programming Languages Quiz: XML/XSD, Perl, SAS, and Java

Test your knowledge across multiple programming languages including XML Schema Definition, Perl scripting, SAS data processing, and Java programming concepts.

20 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

Which ALL are true?

  1. A finalizer may NOT be invoked explicitly.
  2. The finalize method declared in class Object takes no action
  3. super.finalize() is called implicitly by any overriding finalize method
  4. The finalize method for a given object will be called no more than once by the garbage collector
  5. The order in which finalize will be called on two objects is based on the order in which the two objects became finalizable
Question 2 Multiple Choice (Single Answer)

String[] elements = { “for”, “tea”, “too” }; String first = (elements.length > 0)? elements[0] null; What is the result?

  1. Compilation fails.
  2. An exception is thrown at runtime
  3. The variable first is set to null.
  4. The variable first is set to elements[0].
Question 3 Multiple Choice (Single Answer)

Given: System.out.format(”Pi is approximately %d.”, Math.PI); What is the result?

  1. Compilation fails.
  2. Pi is approximately 3.
  3. Pi is approximately 3.141593
  4. An exception is thrown at runtime
Question 4 Multiple Choice (Single Answer)

Variables are not interpolated inside which operator when used normally?

  1. " "
  2. < >
  3. ' '
  4. / /
Question 5 Multiple Choice (Single Answer)

Which of the following statements are correct when using the RETAINstatement?

  1. Variables read with the SET statement will not be affected by it
  2. The RETAIN statement is used when a variable needs to be
  3. Variables will be initialized to the desired value in each iteration
  4. Variables are created during execution
Question 6 Multiple Choice (Single Answer)

x='Hello' y=transwrd(x,'He','HiHiHe') what is the length of y?

  1. 200
  2. 9
  3. 5
  4. 10
Question 7 Multiple Choice (Single Answer)

What is true about ERROR statement

  1. It will be initialised to 1 in the begining
  2. It will have the observation number that caused the error
  3. It will not be dropped while writing into the dataset
  4. It can be used in expressions
Question 8 Multiple Choice (Single Answer)

p = 5461;x='1001';a=x ||'/'||pWhat is the value of a?

  1. 1001/ 5461
  2. Error because of concatenating character and numeric variable
  3. 1001/ 5461
  4. 1001/5461
Question 9 Multiple Choice (Single Answer)

data test; input @1 sal 6.; datalines; $1,234 ; run; What is the value of sal in the test dataset?

  1. Error because of giving formats while the format statement is not provided
  2. Missing
  3. 1234
  4. $1,234
Question 10 Multiple Choice (Single Answer)

Which of the following when evaluated are false?

  1. 1 and 4
  2. 2 and 4
  3. 3 and 1
  4. 2 and 3
Question 11 Multiple Choice (Single Answer)

how many elements are assigned to @u,@w?

  1. 1 and 2
  2. 5 and 0
  3. 1 and 3
  4. none of the above
Question 12 Multiple Choice (Single Answer)

What happens when @_ is modified?

  1. when arrays and references are passed
  2. only when references are passed
  3. args are not changed
  4. Command line args are changed
Question 13 Multiple Choice (Single Answer)

what is the output for printf ("%06.2f", $amt) when $amt = 9.355 ?

  1. 9.3550
  2. 9.4
  3. 009.40
  4. Error
Question 14 Multiple Choice (Single Answer)

What is the outcome of the scenario : open(FH, ">c:\temp\notes.txt") ?

  1. Opens a file notes.txt
  2. fails to create a file and displays error
  3. fails to open a file but doesn't display error
  4. Opens a file but not notes.txt
Question 15 Multiple Choice (Single Answer)

the regex /g.d?c*/ doesn't matches

  1. godccc
  2. gddd
  3. goc
  4. gc
Question 16 Multiple Choice (Single Answer)

which is correct?

  1. 1 can only be called with predecleration of complex_num
  2. 1 and 2 are same
  3. 2 can only be called with predecleration of complex_num
  4. 1 is reference to a subroutine
Question 17 Multiple Choice (Single Answer)

what does the structure create?

  1. A list of hashes which contains a list
  2. A hash of hashes which contains a list
  3. A list of list which contains another list
  4. A list of arrays and hashes containing lists
Question 18 Multiple Choice (Multiple Answers)

XML Schema is developed by?

  1. World Wide Web Consortium
  2. SWIFT
  3. Sun
  4. SAP
Question 19 Multiple Choice (Single Answer)

How many primitive data types does XSD provide?

  1. 4
  2. 8
  3. 10
  4. 19
Question 20 Multiple Choice (Single Answer)

What is the root element in XSD?

  1. <schema>
  2. <xsd>
  3. <root>
  4. <xml>