Java and SAS Programming Fundamentals

Covers fundamental concepts in SAS data steps, Java Collections, EJB, and Servlet programming

20 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

Which implicit object can access the attributes from the ServletContext?

  1. Server
  2. Request
  3. Application
  4. Context
Question 2 Multiple Choice (Single Answer)

When declaring a listener in the DD, which sub-element of the element are required?

  1. <listener-class>
  2. <listener-type>
  3. <listener-name>
  4. <description>
Question 3 Multiple Choice (Multiple Answers)

Which most closely matches a description of a Java Map?

  1. A vector of arrays for a 2D geographic representation
  2. A class for containing unique array elements
  3. A class for containing unique vector elements
  4. An interface that ensures that implementing classes cannot contain duplicate keys
Question 4 Multiple Choice (Multiple Answers)

For a class defined inside a method, what rule governs access to the variables of the enclosing method?

  1. The class can access any variable
  2. The class can only access static variables
  3. The class can only access transient variables
  4. The class can only access final variables
Question 5 Multiple Choice (Multiple Answers)

Which of the following is the correct syntax for suggesting that the JVM performs garbage collection

  1. System.gc();
  2. System.free();
  3. System.setGarbageCollection();
  4. System.out.gc();
Question 6 Multiple Choice (Multiple Answers)

How does the set collection deal with duplicate elements?

  1. An exception is thrown if you attempt to add an element with a duplicate value
  2. The add method returns false if you attempt to add an element with a duplicate value
  3. A set may contain elements that return duplicate values from a call to the equals method
  4. Duplicate values will cause an error at compile time
Question 7 Multiple Choice (Multiple Answers)

Which of the following statements are true?

  1. At the root of the collection hierarchy is a class called Collection
  2. The collection interface contains a method called enumerator
  3. The Set interface is designed for unique elements
  4. The interator method returns an instance of the Vector class
Question 8 Multiple Choice (Multiple Answers)

Which are features every EJB 2.0 container must implement or support? (Answer all that apply)

  1. A GUI bean deployment utility
  2. Transaction support for all bean types
  3. JNDI 1.2 name space
  4. Remote client views for all bean types
Question 9 Multiple Choice (Multiple Answers)

Which are the features in EJB 2.0?

  1. A Portable finder query text
  2. Container managed persistence
  3. Local interfaces for session beans
  4. XML based deployment descriptors
Question 10 Multiple Choice (Single Answer)

Whats true for an entity bean provider using container-manaaged persistent relationship?

  1. Relationships can be one-to-one, one-to-many or many-to-many
  2. A get method return type can use java.util.map
  3. A remote interface is required for such a bean to have bi-directional relationship with another entity bean
  4. Such a bean can have relationships with only message-driven beans
Question 11 Multiple Choice (Single Answer)

When a remote client invokes a method on an entity bean using container managed persistence, and that bean has already been removed, what exception will be thrown?

  1. javax.ejb.AccessLocalException
  2. javax.rmi.NoSuchObjectException
  3. javax.ejb.NoSuchEntityException
  4. javax.rmi.StubNotFoundException
Question 12 Multiple Choice (Multiple Answers)

Given content-managed unidirectional relationship: Foo(0-1) -> Bar(0-1) And the object relations: f1 -> b1 f2 -> b2 What will be true after the following code runs? f2.setBar(f1.getBar());

  1. f1.getBar() ==null
  2. b2.getFoo == null
  3. b1.getFoo == null
  4. none of the above
Question 13 Multiple Choice (Single Answer)

Whats true about EJB QL queries?

  1. The SELECT clause designates query domain
  2. An EJB QL query may have parameters.
  3. The WHERE clause determines the types of objects to be selected
  4. Of the three clause types, SELECT, FROM and WHERE, only the SELECT clause is required
Question 14 Multiple Choice (Single Answer)

Given the EJB QL Expression: p.discount BETWEEN 10 AND 15 Which expression is equivalent?

  1. p.discount > 10 AND p.discount < 15
  2. p.discount >= 10 AND p.discount < 15
  3. p.discount >= 10 AND p.discount <= 15
  4. p.discount > 10 AND p.discount <= 15
Question 15 Multiple Choice (Single Answer)

data student; input sno sname $ marks; datalines; 10 suganya 30 20 preethi 40 30 rathna 40 nitya 50 manasa ; run; The output dataset student contains the following records

  1. sno sname marks { 10 suganya 30} {20 preethi 40} {30 rathna 40} {. .}
  2. sno sname marks { 10 suganya 30} {20 preethi 40} {30 rathna 40}
  3. sno sname marks { 10 suganya 30} {20 preethi 40} {30 rathna } {40 nitya} {50 manasa}
  4. sno sname marks { 10 suganya 30} {20 preethi 40}
Question 16 Multiple Choice (Single Answer)

data flower; Length x $ 5 y $ 11; input x y; datalines; daisyyellow ; run; What is the value of x and y in the output dataset?

  1. NO Observations
  2. x=daisy y=missing
  3. x = daisy y=daisyyellow
  4. x = daisy y=w
Question 17 Multiple Choice (Single Answer)

data state; input name $ @; if name = 'TN' then input famous $; else input lang $; input capital $; datalines; TN food chennai AP telugu hyderabad ; run; The no of times that the input is done for each iteration

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

data new(Keep x y); set old; run; What is the result?

  1. The new dataset will have only variables x and y
  2. Syntax Error.The Keep statement should be (Keep = x y).
  3. The old dataset will have only variables x and y
  4. The new dataset will have all variables
Question 19 Multiple Choice (Single Answer)

proc format; value score. 1-10 = 'High' 11-20 = 'Low' ; run; What is true about this statement?

  1. Format score is created in the SAS catalog
  2. The format name should not end with .
  3. The format can be used in DATA steps
  4. The format can be used in PROC steps
Question 20 Multiple Choice (Single Answer)

data str; x='My name is myuri'; a=find(X,'MY','i',-3); run; What is the value of a?

  1. 1
  2. 12
  3. 10
  4. 2