Java and SAS Programming Fundamentals
Covers fundamental concepts in SAS data steps, Java Collections, EJB, and Servlet programming
Questions
Which implicit object can access the attributes from the ServletContext?
- Server
- Request
- Application
- Context
When declaring a listener in the DD, which sub-element of the element are required?
- <listener-class>
- <listener-type>
- <listener-name>
- <description>
Which most closely matches a description of a Java Map?
- A vector of arrays for a 2D geographic representation
- A class for containing unique array elements
- A class for containing unique vector elements
- An interface that ensures that implementing classes cannot contain duplicate keys
For a class defined inside a method, what rule governs access to the variables of the enclosing method?
- The class can access any variable
- The class can only access static variables
- The class can only access transient variables
- The class can only access final variables
Which of the following is the correct syntax for suggesting that the JVM performs garbage collection
- System.gc();
- System.free();
- System.setGarbageCollection();
- System.out.gc();
How does the set collection deal with duplicate elements?
- An exception is thrown if you attempt to add an element with a duplicate value
- The add method returns false if you attempt to add an element with a duplicate value
- A set may contain elements that return duplicate values from a call to the equals method
- Duplicate values will cause an error at compile time
Which of the following statements are true?
- At the root of the collection hierarchy is a class called Collection
- The collection interface contains a method called enumerator
- The Set interface is designed for unique elements
- The interator method returns an instance of the Vector class
Which are features every EJB 2.0 container must implement or support? (Answer all that apply)
- A GUI bean deployment utility
- Transaction support for all bean types
- JNDI 1.2 name space
- Remote client views for all bean types
Which are the features in EJB 2.0?
- A Portable finder query text
- Container managed persistence
- Local interfaces for session beans
- XML based deployment descriptors
Whats true for an entity bean provider using container-manaaged persistent relationship?
- Relationships can be one-to-one, one-to-many or many-to-many
- A get method return type can use java.util.map
- A remote interface is required for such a bean to have bi-directional relationship with another entity bean
- Such a bean can have relationships with only message-driven beans
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?
- javax.ejb.AccessLocalException
- javax.rmi.NoSuchObjectException
- javax.ejb.NoSuchEntityException
- javax.rmi.StubNotFoundException
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());
- f1.getBar() ==null
- b2.getFoo == null
- b1.getFoo == null
- none of the above
Whats true about EJB QL queries?
- The SELECT clause designates query domain
- An EJB QL query may have parameters.
- The WHERE clause determines the types of objects to be selected
- Of the three clause types, SELECT, FROM and WHERE, only the SELECT clause is required
Given the EJB QL Expression: p.discount BETWEEN 10 AND 15 Which expression is equivalent?
- p.discount > 10 AND p.discount < 15
- p.discount >= 10 AND p.discount < 15
- p.discount >= 10 AND p.discount <= 15
- p.discount > 10 AND p.discount <= 15
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
- sno sname marks { 10 suganya 30} {20 preethi 40} {30 rathna 40} {. .}
- sno sname marks { 10 suganya 30} {20 preethi 40} {30 rathna 40}
- sno sname marks { 10 suganya 30} {20 preethi 40} {30 rathna } {40 nitya} {50 manasa}
- sno sname marks { 10 suganya 30} {20 preethi 40}
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?
- NO Observations
- x=daisy y=missing
- x = daisy y=daisyyellow
- x = daisy y=w
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
- 2
- 1
- 3
- 4
data new(Keep x y); set old; run; What is the result?
- The new dataset will have only variables x and y
- Syntax Error.The Keep statement should be (Keep = x y).
- The old dataset will have only variables x and y
- The new dataset will have all variables
proc format; value score. 1-10 = 'High' 11-20 = 'Low' ; run; What is true about this statement?
- Format score is created in the SAS catalog
- The format name should not end with .
- The format can be used in DATA steps
- The format can be used in PROC steps
data str; x='My name is myuri'; a=find(X,'MY','i',-3); run; What is the value of a?
- 1
- 12
- 10
- 2