GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  I-Flex  >  Technical
Go To First  |  Previous Question  |  Next Question 
 Technical  |  Question 16 of 27    Print  
Which is thread safe ?
(a) Only the variable num
(b) Only the HttpServletRequest object req
(c) Both the variable num & the HttpServletRequest object req


  
Total Answers and Comments: 2 Last Update: December 21, 2009   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 23, 2006 07:57:27   
Rizwan Ahmed        

RE: Which is thread safe ? (a) Only the variable ...

(b) Only the HttpServletRequest object req
Thread safety of the variable is depend on the scope of the variable.

Local variable-thread safe

instance variable-not thread safe(yes for Single thread model)

class variable-not thread safe


 
Is this answer useful? Yes | No
December 21, 2009 15:20:37   
Tejaswini.patil Member Since: November 2009   Contribution: 2    

RE: Which is thread safe ? (a) Only the variable num (b) Only the HttpServletRequest object req (c) Both the variable num & the HttpServletRequest object req
Answer is C
 
Is this answer useful? Yes | No

 Related Questions

In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ? (a) getServletInfo()(b) getInitParameters()(c) getServletConfig()

EjbCreate() method of CMP bean returns (a) null (b) Primary Key class (c) Home Object (d) Remote Object
(a) Explanation: ejbCreate() method of BMP bean returns the Primary Key, where as ejbCreate() method of CMP bean returns null. 

(b) 
Latest Answer : Runnable Interface ...

Which is not allowed in EJB programming ? (a) Thread Management (b) Transient Fields (c) Listening on a Socket

A servlet implements Single Thread model public class BasicServlet extends HttpServlet implements SingleThreadModel { int number = 0; public void service(HttpServletRequest req, HttpServletResponse res) { } }

Which is thread safe ? (a) Only the variable num (b) Only the HttpServletRequest object req (c) Both the variable num & the HttpServletRequest object req

1. what are the different types of design patterns in core java ?2. what do we mean by value object design pattern ?
Read Answers (2) | Asked by : ranjan

1.What will be the output?boolean a = false if (a=true){ System.out.ptinln("Hello");}else{ System.out.ptinln("GoodBye");}2. Hashmap , hashset , ArrayList(true, true, false)3.Which need 
Latest Answer : Compiler error!!!Technically class name should be Upper but its upperthen it should have been initialized as upper var = new upper() but U is in upper case. ...
Read Answers (3) | Asked by : Vartika


 Sponsored Links

 
Related Articles

ODP.NET - OracleCommand Object

ODP NET More About the OracleCommand Object Till now we have seen OracleCommand working with OracleDataReader OracleCommand is not simply meant for OracleDataReader It has got a lot of functionality for itself Let us see few of the most commonly used features of OracleCommand in this section We will
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Microsoft AJAX Library - Object-Oriented JavaScript

Object Oriented JavaScript Objects and classes are implemented differently in JavaScript than in languages such as C VB NET Java or C However when it comes to using them you ll feel on familiar ground You create objects using the new operator and you call their methods or access their fields using t
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

JavaScript Date Object

JavaScript Date Object In this JavaScript tutorial you will learn about date object and methods of date object explained along with syntax and example mosgoogle center JavaScript Date Object Usage of Date Object Date object of Java Script is used to work with date and times General syntax for defini
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

What happens when a variable is not declared in function definition?

Generally in C program the function definition and calling takes the form as given below: main() { int x,y,z; z=sample(x,y); printf(“%d”,z); } sample(x1,y1) int x1,y1; { int z1; z1= x1 - y1; return(z1); } Here what happens is the values x, y gets passed to x1,y1
 

JavaScript Math Object

JavaScript Math Object In this JavaScript tutorial you will learn about Math Object usage properties and methods of math object along with syntax and examples mosgoogle center Usage of Math Object JavaScript Math object is used to perform mathematical tasks But unlike the String and the Date object
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape