Modified PDF R
Modified PDF R
<c:set var="eight">
<c:out value="${4 * 2}"/>
</c:set>
a)0
b)0.8
c)1
d)1.8
3.) How can you execute DML statements (i.e. insert, delete, update) in
the database?
a) PreparedStatement
b) ParameterizedStatement
c) ParameterizedStatement and CallableStatement
d) All kinds of Statements (i.e. which implement a sub interface of Statement)
5.) To execute stored procedure total Stock in a database server, which of the following
code snippet is used?
6.) When a select statement returns only one record with a single column of integer
datatype on invoking resultset.getint(0) causes_____________
8.) Which of the following describes the correct sequence of the steps involved in making
a connection with a database.
a) 1,2,3,4
b) 1,3,4,2
c) 2,1,3,4
d) 4,1,2,3
a) Provide an interface for creating families of related objects without specifying their
concrete classes.
b) Declare an interface for operations that create abstract products.
c) Declare an interface for a type of product objects.
d) Implement the AbstractProduct interface.
a) When you want to provide a collection of classes, you want to reveal just their contracts
and their relationships, not their implementations.
b) When you want to use an existing class, and its interface doesnot match the one you
need.
c) When you need to add responsibilities to individual objects dynamically without
affecting other objects.
d) When you want to separate abstraction and implementation permanently and need
to share an implementation among multiple objects.
13.) A JSP page uses the java.util.ArrayList class many times. Instead of referring the class
by its complete package name each time, we want to just use ArrayList. Which attribute of
page directive must be specified to achieve this. Select the one correct answer.
a) extends
b) import
c) include
d) package
e) class path
14.) Which of the following is used to redirect the response from a servlet to a JSP page?
a) response.sendRedirect()
b) request.sendRedirect()
c) request.forward()
d) response.forward()
15.) Which of the following options represents the XML equivalent of this statement?
<%@ includefile="a.jsp"%>
a) <jsp:includefile="a.jsp"/>
b) <jsp:includepage="a.jsp"/>
c) <jsp:directive.includefile="a.jsp"/>
d) There is no XML equivalent of include directive
17.) If in test.jsp
\${3+2-1}: ${3+2-1}
a) ${3+2-1}: 4
b) \${3+2-1}: 4
c) \${4}: 4
d) ${4}: 4
1.Byusingconstructor
2.Byusinginit
3.Alloftheabove
4.Noneoftheabove
19.) Which of these are common mechanisms for session tracking?
Cookies
URL rewriting
Hidden Form field
All of the above
a) GETmethod
b) POSTmethod
c) HEADmethod
d) PUTmethod
21.) GET is used to get data from Client and POST is used to post data to client.
22.) A Java bean with a property color is loaded using the following statement:
An error gets generated because the value attribute of setAttribute is not defined.
The color attribute is assigned a value null.
The color attribute is assigned a value "".
If there is a non-null request parameter with name color, then its value gets assigned to
color property of Java Bean fruit.
When using the <jsp:useBean/> to reference a Java Bean for use within a JSP, the id
attribute defines _______________.
25. ) Which of the following should be used to find total number of users?
a) ServletRequestListener
b) ServletContextListener
c) HTTPSessionListener
d) HTTPSessionBindingListener
27.) If we run the test suite as junit test, what will be the order of execution of all the four
test classes
RunWith(Suite.class)
@SuiteClasses({
annotationTest.class,
AssertTest.class
CalculateTest.class,
EmployeeTest.class
})
28.) Which of the following method of Assert class checks that an object is null?
a)FixedGen
b)Metaspace
c)MetaGenspace
astring.add("A");
astring.add("B");
astring.add("C");
a) {A-B-C}
b) {A}-{B}-{C}
c) {-A-}{-B-}{-C-}
a) TreeSet
b) LinkedHashSet
c) HashSet
d) concurrentSkipListSet
32.) Pick the class that is NOT part of java collection framework>!
a) Map
b) List
c) Queue
d) Struct
a) Void
b) Lambda
c) Function
d) Regex
a) True
b) False
35.) Name the two types of streams in Java.
a) Sync and async
b) Sequential and parallel
c) Random and ordered
a) Peek() returns the next item in line but dequeue() removes and returns the next item in
line
b) peek() and dequeue() return the next item in line
c) peek() and dequeue remove and return the next item in line
40.) What is the command line tool introduced for JS engine in Java8?
a) jjs
b) jss
c) jfs
d) jbd
41.) Which one of the following statements on Java String is correct?
a) replace() method replaces only first occurrences of a character in invoking string with the
given character.
b) replace() method replaces last occurrence of a character in invoking string with the given
character.
c) replace() method replaces all occurrences of one character in invoking string with the
given character.
d) replace() method replaces all the characters in invoking string with the given character.
43.) In Java, which of these class types supports sequential and parallel processing of
data?
Queue
Lambda
ExecutorService
Streams
44.) Which of the following terminologies are typically used with regards to AOP?
A. Concerns
B. Advice
C. Float
D. Pointcut
a) A, B, and D
b) A, C, and D
c) A, B, and C
d) B, C, and D
47.) Which of the following attributes are valid in a Spring bean definition?
A. ID
B. Map
C. Set
D. Class
a) A and C
b) A and D
c) B and C
d) C and D
48.) What Spring Collection can be used to inject a collection of name-value pairs, where
name and value can be of any type?
a) <set>
b) <List>
c) <map>
d) <props>
a) Context,Parent
b) Id,Class
c) Class,Inner
d) Interface,Id
50.) To use bean definition template, you should add what attribute in the bean?
a) abstract="true"
b) interface="true"
c) class ="com.example.helloworld"
d) public ="true"
51.) Which bean scopes are valid only in the context of a web-aware Spring Application
Context?
a) <props>
b) <prop>
c) <properties>
d) <property>
a) @Component
b) @SpringConfiguration
c) @SpringXml
d) @Configuration
54.) What does the JDBC Template uses to connect to the database?
a) A, B and D
b) A, B and C
c) A, C and D
d) B, C and D
56.) Does Spring provide programmatic transaction management?
a) Yes, with the TransactionTemplate class
b) Yes, with the TransactionService class
c) Yes, using the @Transactional bean post processor
d) No, Spring does not provide transactional management
I. @Controller
II. @RequestMapping
III. @PathVariable
IV. @Autowired
a) I and II only
b) I, II and III only
c) I, III and IV only
d) II and IV only
a) ByName
b) ById
c) @Autowired
d) Constructor
59.) What annotation wiring element is added to scan packages to find and register
Beans within the Application Context?
a) <context:annotation-config/>
b) <context:annotation-scan/>
c) <context:component-config/>
d) <context:component-scan>
60.) To annotate all your Data Access Object (DAO) classes, use the --------
a) @Service
b) @Classes
c) @Repository
d) @Component