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. good understandability code
View Tutorial          By: Raja Mahendra Kumar at 2009-03-05 03:11:26

2. Thanks a lot for valuable program.


View Tutorial          By: Kailash at 2012-07-30 10:09:12

3. After edit tomcat-user file and restart sevice ..i
View Tutorial          By: Rajesh Perumal at 2013-01-08 06:29:21

4. i am in beginning level, i tried by this code. but
View Tutorial          By: Shahana Akter at 2014-09-09 10:30:21

5. gr8t man.....! i am satisfied with ur explanation
View Tutorial          By: raja deepa at 2011-07-05 13:44:21

6. Great Description. Helped a lot.
View Tutorial          By: Dee2019nc at 2009-11-08 18:26:22

7. Hi

I want the java code for i

View Tutorial          By: Deepak at 2015-07-29 15:07:09

8. Most Our friends ask About error occurred during t
View Tutorial          By: Chala G. at 2015-01-13 16:52:10

9. I will try
View Tutorial          By: bridges at 2009-09-06 22:09:46

10. On my blog (http://www.future-edge.nl/blog/adding-
View Tutorial          By: Robert Willems at 2011-11-29 06:26:21