aspose file tools*
The moose likes Servlets and the fly likes Core Java/JSP/SERVLETS/DESIGN PATTERNS Queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Core Java/JSP/SERVLETS/DESIGN PATTERNS Queries" Watch "Core Java/JSP/SERVLETS/DESIGN PATTERNS Queries" New topic
Author

Core Java/JSP/SERVLETS/DESIGN PATTERNS Queries

Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Below are few Core Java/JSP/SERVLETS/DESIGN PATTERNS Queries.
Please let me know the answers.

1>what is the difference between Value Object(VO) and Java bean?
2>what is the difference between arraylist and linkedlist?
3>what is a Business delegate design pattern?
4>how do we implement singleton design pattern in a Servlet?
5>{Code for a servlet below starts}

init(){
int i=10;
}

service(){
out.println(i);
}
//what is the ouput in this case??
{Code for a servlet ends}
6>what are the differences between HashMap and HashTable?
7>How do you read a Large file(Example ..size > 2 MB) from database?
8> how do to read a CLOB,BLOB Objects from database?
9> what is the difference between BufferedInputStream and FileReader ?
10> how do to write my own Exception class.?
11> By default,how do to get the objects in a collection sorted ?

Help provided will be highly appreciated.

[Edit: removed needless bolding]
[ September 21, 2008: Message edited by: Bear Bibeault ]

When The Going Gets Tougher,The Tougher gets Going
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

JavaRanch is not the place to come and get your homework done for you. What are your answers to the questions? We'll help you clarify any confusion you might have, but no one here will do your work for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi Bear Bibeault,
I do understand that no one will do my home work but for the above queries i'm unable to find the answers and i do not know how to find out the answers for the same.I did do a google search but could not get any help.hence im posting on the forum.

If you think im justifying in a right way.Please accept my request and let me know the answers.
tapeshwar sharma
Ranch Hand

Joined: Mar 10, 2006
Posts: 245

I do understand that no one will do my home work but for the above queries i'm unable to find the answers

My 2... no...3 cents:
1)There is no need for a Bear Bibeault for such questions.
2) Actually, there is no need for anyone for such questions.Let me introduce you to my Genie.Have fun.
3)In case you just want to chat with Bear, there is a meaningless drivel forum in Java Ranch where you can initiate a few threads.With good luck, you might be able to lure him to at least one.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi prashant bhardwaj and other guys,
Please help me out with answers.Requesting you once again

--
Deepak Lal
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

1>what is the difference between Value Object(VO) and Java bean?

Value object is a pattern, a bean is a specification

2>what is the difference between arraylist and linkedlist?

Please check the Java API

3>what is a Business delegate design pattern?

Sound like one for the Pzattern's forum

4>how do we implement singleton design pattern in a Servlet?

More input. Why would you?

5>{Code for a servlet below starts}

init(){
int i=10;
}

service(){
out.println(i);
}
//what is the ouput in this case??
{Code for a servlet ends}

You should try this and see.

6>what are the differences between HashMap and HashTable?

Again you should get used to using the API

7>How do you read a Large file(Example ..size > 2 MB) from database?

Please ask this in the JDBC forum.

8> how do to read a CLOB,BLOB Objects from database?

As above.

9> what is the difference between BufferedInputStream and FileReader ?

PLease ask this in the Streams forum. The API would help, though.

10> how do to write my own Exception class.?

Please ask in the beginner forum.

11> By default,how do to get the objects in a collection sorted ?

Se the API for the java.util.Collections class
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi Shreiff,


4>how do we implement singleton design pattern in a Servlet?
More input. Why would you?

Asked in the interview..do you know the answer for the same?

David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I think the pointh they wanted you to bring up was there is a single instance of a Servlet created for each servlet-mapping. In a basic sense this means that for any Servlet class there is usually only a single instance created, which makes it act as a Singleton.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi David O Mearra,
Hence you mean to say there is no need to implement Singleton design pattern in a Servlet,Because by default,it acts as a singleton(single instance of servlet is created for each servlet mapping).

Please let me know if my interpretation is correct ?

--
Deepak Lal
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Sounds OK.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Thanks a lot Shreiff(David O Merra) and other's for supporting me with valid answers for above queries.

Thank you once again....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Core Java/JSP/SERVLETS/DESIGN PATTERNS Queries