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. Fine,you r very straightforward I like that

View Tutorial          By: Shaiju at 2010-02-21 10:15:00

2. hi can any one help me how to do basic pc actions
View Tutorial          By: karthikeyan at 2008-03-14 04:18:52

3. steps 2 create and use tiles
View Tutorial          By: sasank at 2008-10-03 08:06:43

4. Hello Ramlak, I am too getting
java.lang.U

View Tutorial          By: Amruta at 2008-11-07 23:56:17

5. Very good. but why i can search data then report v
View Tutorial          By: ARMAN AHMED at 2015-04-27 13:18:04

6. why have you change first name oak to java ?
View Tutorial          By: manohar patil at 2014-08-20 03:44:23

7. good
View Tutorial          By: saravanan at 2007-03-02 23:16:00

8. There something at Example #2! because when i try
View Tutorial          By: Paul at 2011-08-01 14:38:14

9. Dear any buddy i use Nokia N73 and connect with Bl
View Tutorial          By: zstranger at 2012-03-29 07:47:02

10. i tried with d above code but am getting an error
View Tutorial          By: Aishwarya at 2009-04-05 04:41:17