Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Sapient Interview Questions

Answers were Sorted based on User's Feedback



Sapient Interview Questions..

Answer / jitendra narang

Sapient Interview Questions
It will be an online test of 42 questions. The test is
arranged with the help of a consultancy known as

IKM (International Knowledge Measurement) which arranges the
test.

Question 1. What will be the output of the following program?
public class Example {
public static void main(String... args) {
for(int x=0,y=0; x>y; x--,y++){
System.out.println(x + " " + y + " ");
}
}


Question 2. What will be the output of the following program?
public class Sample {
public static void main(String... args) {
int i=0, j =0;
while(i++ < 2)
{
do{
System.out.println(j + " ");
}while(j++ < 2);
}
}
}
Question 3. What will be the output of the following program?
public class Test {
public static void main(String... args) {
List lst = new ArrayList();
for(int i = 1; i < 5; i++)
lst.add(i);
Iterator iter = lst.iterator();
for(Object e : lst)
System.out.println(e);

Question 4 : Which of the following is correct definition of
doGet() method of a http servlet?

a) public void doGet(HttpServletRequest request,
HttpServletResponse response) throws

ServletException, IOException {

b) public void doGet(ServletRequest request, ServletResponse
response) throws httpServletException,

IOException {

c) public void doGet(HttpServletResponse response,
HttpServletRequest request ) throws

ServletException, IOException {

d) private void doGet(ServletResponse response,
ServletRequest request ) throws

HttpServletException, ServletException {


Question 5 : Which of the following will not compile?

a) execute() method on callable statement
b) executeQuery() method on statement
c) executeQuery() method of prepared statement.
d) execute() method of statement.


Question 6 : Which of the following are not valid methods of
EJBContext?

a) abstract public EJBHome getEJBHome();
b) abstract public EJBLocalHome();
c) abstract public EJBRemote getEJBRemote();
d) abstract public Properties getenvironment();

Question 7 : Which of the following piece of code is used to
the update the checked radio buttons

unchecked?
options were like document.frm.test.selected = false;

Question 8 : Which of the following helps increase the Tight
Encapsulation of a class?

Question 9 : Which of the following SQL query can be used to
fetch the customers from customer table

where zip is either '23' or '456' and unique last name?

Answer : select distinct last_name from customers where zip
in ('23', '456');

Question 10 : Creating a stateless session bean contains
calls of which of the following methods.

Question 11 : Which of the following methods can be used to
determine if current HttpSession object

came from a cookie or from an encoded URL ?

Options were like isSessionIdFromCookie() etc

Question 12 : this() and super() constructors can be used at
the same time or in the same constructor or

one below the other or cannot be used at the same time?

Question 13 : There was a question on 'OnMouseOver' event in
Java Script.

Question 14 : Scalar Functions in DBMS.
test
Which of the following are displayed in window status bar?


Question 15 : Which of the following can be used with switch
case :

switch case
a) float double
b) float char
c) byte char
d) char int
e) int char

Question 16 : What will be the output of the following piece
of code?
public class Sample {
public static void main(String... args) {
List lst = new ArrayList();
lst.add("1");
lst.add("2");
lst.add("1","3");
lst.add("2", "4");
System.out.println(lst);
}
}

Is This Answer Correct ?    98 Yes 29 No

Sapient Interview Questions..

Answer / manveer

Answer of Question 16:

Compile time error : The method add(int, Object) in the type List is not applicable for the arguments (String, String).

Is This Answer Correct ?    25 Yes 3 No

Sapient Interview Questions..

Answer / niharika

Answer to Question 6 : Which of the following are not valid
methods of
EJBContext?
Ans:
getEJBRemote

Is This Answer Correct ?    26 Yes 6 No

Sapient Interview Questions..

Answer / dd

Is This Answer Correct ?    8 Yes 2 No

Sapient Interview Questions..

Answer / akshay

in first question answer is terminated without print any thing

Is This Answer Correct ?    6 Yes 0 No

Sapient Interview Questions..

Answer / vipul

Answer 1 no output

Is This Answer Correct ?    2 Yes 0 No

Sapient Interview Questions..

Answer / vipul

Answer 2 output is
0
1
2
3

Is This Answer Correct ?    2 Yes 1 No

Sapient Interview Questions..

Answer / saurav

0
1
2
Output for q2

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More J2EE Interview Questions

Why java is called robust and secure?

0 Answers  


how many external variables are there in jsp ?

1 Answers  


How will you explain load() and get() methods?

0 Answers  


public class ActionSearchBean extends GenericSearchBean<ActionDTO, Long, ActionDTO> { @Override public String search() { data.setRowCount(null); if(data.getRowCount()==0){ data.getNoRecordFound().setRendered(true); data.getDataScroller().setRendered(false); } return "searchAction"; } @Override public String clear() { data.setRowCount(null); if (data.getRowCount() > 0){ data.getNoRecordFound().setRendered(false); data.getDataScroller().setRendered(true); }else{ data.getNoRecordFound().setRendered(true); data.getDataScroller().setRendered(false); } data.setModel(new ActionDTO()); data.setRowCount(null); return "searchAction"; } } what is the purpose of @Override ...what will do @Override here ?

0 Answers   Sony,


What are web technologies in java?

0 Answers  


What are the component of java?

0 Answers  


What is j2ee tutorial?

0 Answers  


What is distributed application?

0 Answers  


Define authorization constraint?

0 Answers  


How long does it take to master java?

0 Answers  


I am newbie in J2EE & looking for strong basic behind each concept as, Why do we use private access specifier before each variable of type property bcoz ultimately to access it outside the class we use public method as getter & setter ? If we use getter & setter to access it outside the class so better we make variable as public so that it is easily available outside of the class... Please guide me why do we use as private ????

3 Answers   CTS,


What is bean factory, have you used xmlbean factory?

0 Answers  


Categories