Questions about Java's String pool



Share on Google+Share on Google+

Java Coder
Questions about Java's String pool
1 Answer(s)      3 years and 8 months ago
Posted in : Java Beginners

Questions about Java's String pool

View Answers

December 24, 2013 at 3:15 PM

There is how you can define a string pool in Java

String s = "abc";
String p = "abc";

but in this way String object, s and p will both be referring to that same String object.

another way to define is :

String s = new String("abc");

Java pool tutorials Java-Connection Pool : source code
Java String intern() : Example


Related Tutorials/Questions & Answers:
Questions about Java's String pool
Questions about Java's String pool  Questions about Java's String pool
String - Java Interview Questions
Java String array declaration and initialization  I am looking for an example of java string array declaration and initialization  Hipublic class ImmutableCart { private final List items; public ImmutableCart(List
String - Java Interview Questions
String  i have a String s1="abc"; String s2="123"; then how to get a String s3="a1b2c3
STRING IMMUTABLE - Java Interview Questions
the String Pool.It will refer the String object from pool to achieve the memory... a new string literal, it has to be checked in the pool whether it exists... in the pool. There will be many references point to the same String objects
About Java - Java Interview Questions
About Java  what is edition of java? versions of weblogic? what r the webserver applications used in your application
String Comparison - Java Interview Questions
String Comparison  How to compare string in Java?  Hi... static void main(String[] args) throws IOException{ BufferedReader buff = new... the first string !"); String str = buff.readLine(); System.out.println
String doubts - Java Interview Questions
String doubts  difference between String and StringBuffer
about interview ques. - Java Interview Questions
about interview ques.  i give a interview for java.. they ask me..., It is the syntax of Java used to display a string on the console window... the specific string onto output device. Thanks
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database... is Weblogic 8. Which is the best approach to create a connection pool? ...{ public static void main(String[] args){ Connection con = null; String url
about MVC in java - Java Interview Questions
about MVC in java  hi, In MVC Architecute can the Model and View can communicate directly or not?  Hi friend, For read in details MVC Architecture visit to :
about threading in java - Java Server Faces Questions
about threading in java  Hello Sir how can i write a program using threads and which need to check and compare the system date and time every day at certain time(eg:12 o clock in noon).. based on this comperision of time i
About Object cloning. - Java Interview Questions
About Object cloning.  what is Object cloning? can u explain... is said to be object cloning.In java, it has to be done using clone() method. For more information, visit the following link:
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database is MS SQL server 2000(username-sa, pwd-admin) and my application server is Weblogic 8. Which is the best approach to create a connection pool? Kindly help
About interview questions
About interview questions   I want interview questions on IDE's Please send links
Java String
Java String       In this section, you will learn about the java string. Java String is a set... to a string literal in the object stream. The Java String object contains a sequence
string - Java Beginners
string in java interview questions  What is string in java? Interview questions
Swimming Pool Calculator - Java Beginners
Swimming Pool Calculator  I have to write a program to calculate the volume of a swimming pool. The assignment is as follows: This Swimming Pool... depth of a pool and the program will calculate the volume of that pool based
confused about writing to /resources directory - Java Server Faces Questions
confused about writing to /resources directory  hello I am confused about writing to /resources directory how can I put an image which resides... with java code ? regards  Hi friend, Plz specify in details. Where
JDBC Connection Pool
JDBC Connection Pool In this section we will learn about JDBC Connection Pool and see how to use Apache DBCP for creating the database connection pool. We... pooling. What is JDBC Connection Pool? The database connection is expensive
Swimming Pool Calculator - Java Beginners
Swimming Pool Calculator  When I run the program the login window... void actionPerformed(ActionEvent ae) { String value1=text1.getText(); String...(String arg[]) { try { Login frame=new Login(); frame.setSize(300,100
and filling pools. Create pool class that calculates the price of a service call... on the amount of time it will take to fill a customer's pool with water. Table below...) for a pool. Pool class should have methods to calculate volume, capsity
Swimming Pool Calculator - Java Beginners
Swimming Pool Calculator  Okay, so I tried making the program... ); JLabel lengthLabel = new JLabel( "Enter the length of swimming pool(ft... of the swimming pool(ft):" ); widthLabel.setBounds( 10, 60, 260, 20 ); pools.add
Java - Java Interview Questions
Java  Questions on Java
i need a quick response about array and string...
i need a quick response about array and string...  how can i make a dictionary type using array code in java where i will type the word then the meaning will appear..please help me..urgent
Java Thread not geting Connection pool - JSP-Servlet
Java Thread not geting Connection pool  Hi All, Please help me in following problem. I have database connection on server using connection pool. There is on background process which will get execute when user click button
Reverse String Program in Java
Reverse String Program in Java We are going to describe about reverse string program in java. In this example reverses a string entered by the user. We... source code More tutorials on String handling in Java: Java
About Java
About Java  Hi, Can anyone tell me the About Java programming language? How a c programmer can learn Java development techniques? Thanks   Hi, Read about java at Thanks
Java string
Java string  Strings are immutable.But String s="Hello"; String s1=s+"World"; S.O.P(s1); means printing "Hello World". How
String intern()
that has an entry in the global string pool. And if the string is not in global string pool then it will be added. If the pool already contains a string equal... then on invoking the intern method the string from the pool is returned. Otherwise
String replaceAll in java
String replaceAll in java In this section you will learn about replaceAll() method  in java, This will replace each of the sub string  with the given replacement. This method will return the resulting string. Syntax
About java
About java   how we insert our database data into the jTable in java... in java   Hi Friend, Try the following code: import*; import...); } public static void main(String arg[]) { try { JTableDatabase frame