Final
Final
===========
1.public class Bran{
public static void main(String args[]){
new Barn( ).go("hi",1);
new Barn( ).go("hi","world",2);
}
public void go(String... y,int x){
System.out.print(y[y.length-1]+" ");
}
}
What is the result
1.hi hi
2.hi world
3.world world
4.Compilation fails
Ans:4
Ans:4
3. class Atom{
Atom(){System.out.print("atom");}
}
class Rock extends Atom{
Rock(String type){System.out.println(type);}
}
public class Mountain extends Rock{
Mountain(){
super("granite");
new Rock("granite");
}
public static void main(String[] a){new Mountain( );}
}
what is the resul
What is the result
1. Compilation fails
2. atom granite
3. granite granite
4. atom granite atom granite
Ans:4
4.Given the Spring configuration file which are the correct statements
<bean class
="com.spring.service.BankServiceImpl"p:bankName="NationalBank">
</bean>
1. the P namespace has to be declared
2. Bean id is bankServiceImpl
3. The BankServiceImpl refernces a NationalBank bean
ANS:1
5.Given the following Spring Configuration file what is the Correct answer
<bean class="com.spring.service.MyserviceImpl">
<property name="repository" ref="jpaDao"/>
</bean>
<bean class="com.spring.repository".JpaDao"/>
1. The first declared bean MyServiceImpl is missing an id must be named
myService
2. The Second declared bean JpaDao is missing an id must be named
jpaDao
3. Answer 1 and 2 are both rights
4. Answer 1 and 2 are both Wrongs
ANS:2
6.File Entries Imagines that you have a customer files and that you wish to count
the total number of records.Which of the Following JSP structures do you think
would be appropriate to use
1. Sequence
2. Iteration
3. Decision
ANS:2
Ans:2
10.How can you make a property be read from the database but not modified in
any way
1. By using the insert=”false” and update=”false” attributes
2. By using the isinsert=”false” and isupdate=”false” attributes
3. By using the isinsert=”no” and isupdate=”no” attributes
4. NONE
Ans:1
11. What will be the output of the program?
class PassS
{
public static void main(String [] args)
{
PassS p = new PassS();
p.start();
}
void start()
{
String s1 = "slip";
String s2 = fix(s1);
System.out.println(s1 + " " + s2);
}
A. slip stream
B. slipstream stream
Ans:D
12.Which implicit object is used in a JSP page to retrieve values associated with
<context-param> entries in the deployment descriptor
1. config
2. request
3. session
4. application
Ans:4
15.Which listerner should useto find context has been created or destroyed?
1. ServletContextListener
2. ServletContextAttributeListener
3. HttpContextListener
4. Allthe Above
ANS:1
16.If you want to track active session or how many users are there?so which
listener you should use
1. ServletRequesListener
2. ServeletContextListener
3. HttpSessionListener
4. HttpSessionBindingListener
Ans:3
18.In which of the following type of ResultSet, the cursor can scroll forwards and
backwards, and the result set is sensitive to changes made by others to the
database that occur after the result set was created?
A - ResultSet.TYPE_FORWARD_ONLY
B - ResultSet.TYPE_SCROLL_INSENSITIVE
C - ResultSet.TYPE_SCROLL_SENSITIVE
Ans:C
19.Which of the following is used generally used for altering the databases?
Ans:c
Ans:D