praveena reddyk

Greenhorn
+ Follow
since Sep 25, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by praveena reddyk

Hi,
SingleThreadModel ensures that servlets handle only one request at a time .In SingleThreadModel, it is guaranteed that no two threads will execute concurrently in the servlet's service method.

There are two ways of implementing SingleThreadModel:

1.The servlet container synchronizes access to a single instance of the servlet, i.e there is only single instance of servlet which process every incoming request.
2. container maintaines a pool of servlet instances and dispatches each new request to a free servlet.
Thanks
thats i know instead of going to vector for synchronization we can use
collections framework methods other than this is there any other
difference since in an interview i got this who is expecting more
16 years ago
Hi
can anybody explain me about arraylist and vector other than arraylist is unsynchronized whereas vector is not.
16 years ago
String s1="s1";
if you are using a String literal then "s1" will be placed in a String constant pool.
if you assign same value with a new fererence i.e String s2="s1";
it checks to find if there is already "s1" in string constant
pool if it is there it will adjust s2 to that now both s1 and s2
are pointing to the same value "s1". so s1==s2 gives true.

But if you write like this s1="s2"; then if there is no value "s2" in String constant pool it will create a new one(i.e "s2") and adjust the reference s1 to "s2" now s1 is pointing to "s2" and s2 is pointing to "s1" and output is s1==s2 is false.
16 years ago
Hi,
Parent parent=new Child(); at this line both parent class and child class constructors executes and when parent.move() is called the method in child class since it inherits that from parent class.
Child child=new Child(); at this line again the construtors execute and child.move(); is called the method in the child class is executed.
16 years ago
What happens internally when I use parent reference which holds child object and child reference for holding the hcild object here?

Hi

Parent p = new Child();
p.run();
Here your using parent class reference to point to the sub class object during runtime so if you use p.run() it will call the run() method in child class.
But the code you have written gives compilation error because during compilation compiler sees that p is a reference of type parent and checks for the run() method but it didn't find that in parent class gives method run() undefined for parent.
16 years ago
how can we tell that exception is checked exception or unchecked exception name for example IOException is Checked and NullPointerException is unchecked.
16 years ago
can anybody explain me about throw and throws keywords.
i know that throw is used for throwing the exception manually
and throws for indicating the user for indicating that so and so
method may are maynot throw the exception. otherthan that is there anything more.
16 years ago

Originally posted by Amit Ghorpade:
Hi praveena reddyk welcome to Javaranch ,
The topic title "servlet" in a forum dedicated to servlets isn't much meaningful. Please make it more descriptive. Read this for more information.

I am not getting your question here, will you please give some details.




Hi Amit,
My question is GenericServlet is having an abstract service() method and HttpServlet class is extending the GenericServlet but the service() method in HttpServlet is having HttpServletRequest and HttpServletResponse as parameters so it is overloading version of GenericServlet service() method. since HttpServlet is defined as abstract it is still having the service() method of GenericServlet without implementation. if we write our own servlet we are overidding the HttpServlet Service() method. so my question is who is implementing the GenericServlet service() method.
16 years ago

Originally posted by Amit Ghorpade:
Hi praveena reddyk welcome to Javaranch ,
The topic title "servlet" in a forum dedicated to servlets isn't much meaningful. Please make it more descriptive. Read this for more information.

I am not getting your question here, will you please give some details.

16 years ago
The Syntax of HttpServlet service() method is like overloading the
service() method of GenericServlet so which class is implementing the
service() method of Servlet Interface.
16 years ago