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
| FAQ | Members List | 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Thread Tools Search this Thread 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, 05: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 Search this Thread
Search this Thread:

Advanced Search
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 03: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 04:55 PM.

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