Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Espanol
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Espanol section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old May 14th, 2005, 10:15 AM
Registered User
Join Date: Feb 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default String pooling?

What is String pooling in java?

  #2 (permalink)  
Old November 3rd, 2006, 04:31 AM
Registered User
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

    When you create string literals jvm maintain all of them in pool known as String pooling.
for exapmle,

    String s1 = "Arul"; //case 1
    String s2 = "Arul"; //case 2

    In case 1, iteral s1 is created newly and kept in the pool. But in case 2, literal s2 refer the s1, it will not create new one instead.

      if(s1 == s2) System.out.println("equal"); //Prints equal.

      String n1 = new String("Arul");
      String n2 = new String("Arul");
      if(n1 == n2) System.out.println("equlal"); //No output.



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pooling in IIS6 aliirfan84 ASP.NET 2.0 Professional 1 May 16th, 2007 07:14 AM
Connection Pooling nigam.anand Apache Tomcat 0 October 18th, 2006 08:39 AM
Connetion pooling problem wakeup BOOK: Professional Jakarta Struts 0 April 11th, 2005 09:03 AM
Connection pooling in VB vijayma VB How-To 0 March 18th, 2005 02:51 AM
Connection Pooling with Beans angrycat Apache Tomcat 4 September 16th, 2004 06:11 PM

All times are GMT -4. The time now is 05:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.