You are on page 1of 39

Question Option A

HTTP2 Client API is introduced in Java 9 1


What is the max capacity of a Java BlockingQueue Integer.INFINITY
In Java 9, private methods are allowed in Interfaces 1
Identify the Java class used to create a new Process ProcessBuilder
Pick the correct Java method reference usages object::instanceMethod
maximum number of methods in Functional Interface. 0
What are JSR 250 annotations?
Which of the following can be modified array
Which of the following is the immutable Java List static factory m List.of
In Java,it is NOT possible to override default serialization. 1
Which is the correc tJavacode snippet to be used to create a FuncinterfaceMyFunctionalInterfa
Which one will allow traversing a Java collection in each direction ListIterator
Which of these OOPS concept is enabled by method overriding inPolymorphism
How does one assign system property values to variable using Jav @Autowire(..)
Option B Option C Option D
FALSE
Integer.MAX_VALUE BigDecimal.MAX_VALUE
FALSE
ProcessFactory Process Thread
Class::staticMethod Class::new All of the above
1 2 unlimited

arrays arraylist -
List.immutable List.create
FALSE
"@FunctionalInterfaceinte"@FunctionalinterfaceMyFunctionalInterface{"
Iterator SetIterator MapIterator
Abstraction Inheritance Encapsulation
@Environment(..) @Property(...) @Value(...)
Answer
TRUE
Integer.MAX_VALUE
TRUE
ProcessBuilder
All of the above
1
@PostConstruct, @PreDestroy and @Resource

arraylist
List.of
FALSE
Option 2

Polymorphism
Value(...)
Question
Fill in the blank.
This is an example of preparedstatement interface that_______________
PreparedStatementstmt=con.prepareStatement("select*from emp");
ResultSetrs=stmt.executeQuery();
while(rs.next()){
System.out.println(rs.getInt(1)+""+rs.getString(2));
}

How can you retrieve information from a ResultSet?

In the snippet below, what line of code needs to be added to move the cursor to the
3rd row in the resultset?
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","or
acle");
Statement
stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_
UPDATABLE);
ResultSetrs=stmt.executeQuery("select*from emp765")
Option A
Deletes the record

By invoking the method get(...,Stringtype) on the ResultSet, where type is th

rs.move(3);

et.CONCUR_
Option B
Retrieves the record

By invoking the method get(...,Typetype) on the ResultSet, where Type is an object which represe

rs.next(3);
Option C
Updates the record

By invoking the method getValue(...), and cast the result to the desi

rs.absolute(3);
Option D Answer
Inserts the record Retrieves the record

By invoking the special getter methods on the ResultSet:getString(...),getBoolean


(...),getClob(...) Option 4

rs.getString(3); rs.absolute(3);
Question Option A Option B Option C Option D Answer
Question
what do we use builder for in design patterns? Option A

You are creating an instance diagram using UML and you need to show that. How would you do that ?
httpSession
what servesfunction
does lambda http or https?
return?

something
benefits of on parameters
data injection ?of beans or xxxxx where I opted for ID and CLASS.

Java system properties can be set or modified at runtime


Is math.random() < 0.5 if less print hi else print hello
Which Collections elements does Spring support? List,hashmap,arraylist,an
The Dependency Look up is a methodology where we getFactory
th Method
Option B Option C Option D Answer

show that. How would you do that ?

List,props,hashmaps,andarrayl
List,set,map,andprHashmaps,arraylist,list,andt Option B
JNDi method Key word method All of the above All of the above
of the above
Question Option A Option B
A user types the URL in a browser: GET methoPOST metho
http://www.javatraining.com/GH/index.html. Which HTTP request gets generated?
Option C Option D Answer
HEAD methoPUT methoGET method
Question Option A Option B
Is the resultset Updateable? (Study this topic dont remember options)
By default, ResultSet object can be moved forward only and it is not updatable.

But we can make this object to move forward and backward direction by passing either TYPE_SCROLL_INSENSIT

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,


ResultSet.CONCUR_UPDATABLE);

commit(), rollback(), setAutoCommit(), setTransactionIsolation() are connection statement


Option C Option D Answer

r TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE in createStatement(int,int) method as well as we can make

resultSet - connection
od as well as we can make this object as updatable by:
Question Option A Option B Option C Option D Answer
Question Option A Option B Option C Option D
Answer
Question Option A Option B Option C Option D Answer
Question Option A Option B Option C Option D
Answer
Question Option A Option B Option C Option D
Answer
Question Option A Option B Option C Option D Answer
Question
You are creating a class diagram using UML and you need to show that one of y
classes is an abstract class. How would you do that?
Option A Option B
Underline the name of the class in the Draw a dotted line between it and the other
Option C Option D
Use italics for the name of the class Draw an arrow with a hollow diamond head between it and the o
Answer
Option 3
Question Option A Option B Option C Option D Answer
Question Option A Option B Option C Option D
Which of the following is used aspect progr AOP Servlet JDBC Spring
Answer
AOP
Question Question
What attribute is added in the bean.xml to reduce or eliminate the need of and? Autodiscovery
Option B Option C Option D Answer
Autowire Scope Auto-detect Autowire
Question Option A Option B Option C Option D Answer
Question Option A Option B Option C Option D
how can you initialize beanInitializingB BeanInit Initializing InitBean
Answer
InitializingBean
Question Option A Option B Option C Option D Answer

You might also like