Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Java General Java String and StringBuffer Tutorial

As you know, Strings are objects in Java code. These objects, however, are immutable. That is, their value, once assigned, can never be changed.

Tutorial Details:

String and StringBuffer

Immutability of String objects
As you know, String s are objects in Java code. These objects, however, are immutable . That is, their value, once assigned, can never be changed.

Here the original String "Hello" is not changed. Instead, a new String is created with the value "Hello World" and assigned to the variable msg . It is important to note that though the String object is immutable, the reference variable is not.

String literals
In Java code, the String literals are kept in a memory pool for efficient use.
If you construct two String s using the same String literal without the new keyword, then only one String object is created.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Java General Java String and StringBuffer Tutorial

View Tutorial:
Java General Java String and StringBuffer Tutorial

Related Tutorials:

Designing with exceptions - JavaWorld - July 1998
Designing with exceptions - JavaWorld - July 1998
 
Build servlet-based enterprise Web applications - JavaWorld - December 1998
Build servlet-based enterprise Web applications - JavaWorld - December 1998
 
Java Tip 77: Enable copy and paste functionality between Swing's JTables and Excel - JavaWorld
Java Tip 77: Enable copy and paste functionality between Swing's JTables and Excel - JavaWorld
 
StringBuffer versus String - JavaWorld March 2000
StringBuffer versus String - JavaWorld March 2000
 
Build an object database, Part 2: Object storage backend - JavaWorld April 2000
Build an object database, Part 2: Object storage backend - JavaWorld April 2000
 
Performance books put to the test - JavaWorld March 2001
Performance books put to the test - JavaWorld March 2001
 
Java's character and assorted string classes support text-processing
Java's character and assorted string classes support text-processing
 
J2ME devices: Real-world performance
J2ME devices: Real-world performance
 
Call JavaBean methods from JSP
Call JavaBean methods from JSP 2.0 pages
 
The Java Web Services Tutorial
This tutorial is a beginner\'s guide to developing Web services and Web applications using the Java Web Services Developer Pack (Java WSDP).
 
Good, but obsolete
Good, but obsolete
 
Understanding the Interplay Between Utility Classes and Static Initialization
Java is an OO language, which means much of the functionality of a Java application is encapsulated into cohesive classes that can be instantiated and acted upon.
 
The JDBC RowSet Implementations Tutorial
In "The JDBC RowSet Implementations Tutorial," you will look at how to use the standard JDBC RowSet implementations specified in JSR-114.
 
Java Servlets: Design Issues
This article covers the principal concepts associated with servlets. This article examines some of the design issues, and offers some guidelines on the applicability of Java servlets for web based application development.
 
Servlet Essentials
This document explains the concepts of Java Servlets and provides a step-by-step tutorial for writing HTTP Servlets with complete source code for the example Servlets. The tutorial and the other chapters cover all facets of Servlet programming from a ...
 
The JavaTM Web Services Tutorial
A beginner's guide to developing Web services and Web applications on the Java Web Services Developer Pack
 
JSP Tutorial
This Tutorial is for beginners in the Java Server Pages Technology
 
JavaServer Pages Technology - Documentation
Sun's tutorial for Java Server Pages that provide a good introduction to design web pages with JSP.
 
Generating an XML Document with JAXB
In this tutorial, JAXB is used to generate Java classes from an XML Schema. An example XML document shall be created from the Java classes.
 
Adding slash "\" character before quote "'" in a query
Adding slash "\" character before quote "'" in a query Adding slash " \ " character before quote " ' " in a query During the inserting the records in the database if user enters the phrases like "What ' s your name?", database gives the error due
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.