Comment on Tutorial - append() in Java By Jagan



Comment Added by : Mohamed firnaz

Comment Added at : 2011-12-07 04:54:27

Comment on Tutorial : append() in Java By Jagan
Excellent. I want you to publish about memory allocation for every sample programs side by side, as it plays a major role in live projects. For example :

public class stringmemory
{
public static void main(String[] args){
String str = "Sri seshaa";
String str1 = " Sri seshaa";
String str2 = str + str1 + " technologies";

StringBuffer s;
String d;
StringBuffer bufr = new StringBuffer(str);
s = bufr.append(str2);
d = String.valueOf(str);
System.out.println("......");
System.out.println(str2);
System.out.println("......");
System.out.println(d);
}
}

In this the memory allocated for concatenation in string class is more compared to the append operation in StringBuffer. Like this there are many advantages and disadvantages in it. Please publish it also, it will be helpful for the young programmers like me.


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. I am java developer and interested to write scjp e
View Tutorial          By: Parvathi at 2013-07-05 14:24:08

2. nice
View Tutorial          By: narendra at 2012-04-23 09:40:00

3. hi gud mrng........
i wanna connectivity of

View Tutorial          By: sac at 2011-09-02 04:56:43

4. Hello sir, I observe that in the first version of
View Tutorial          By: Ganny at 2012-08-13 17:04:58

5. I've been satisfied with your tutorial site. Since
View Tutorial          By: Mark Harold F. Manguino at 2008-08-06 05:00:54

6. helpfull !!!!
View Tutorial          By: Anonymous at 2009-05-12 03:48:15

7. I download this program, but I need how to run. wh
View Tutorial          By: prabha at 2011-06-21 04:52:42

8. thank u sir ,this helped a lot
************

View Tutorial          By: yugandharr at 2012-09-11 15:47:19

9. Hi, please do you know how can i use a cel connect
View Tutorial          By: nobody at 2010-04-06 20:25:54

10. Great! Concise, helpful, a real life-saver. Google
View Tutorial          By: Motti Shneor at 2012-07-31 14:29:37