Thursday, 28 April 2016

Java Tutorial : Java StringBuilder [charAt(int index) method]


Click here to watch in Youtube :
https://www.youtube.com/watch?v=FBJefPdwsa4&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Java StringBuilder [charAt(int index) method] 
CharAtDemo.java
/*
 * public char charAt(int index)
 * 
 * Parameters:
 * ----------                           
 * index - the index of the desired char value.
 * 
 * Returns:
 * -------- 
 * the char value at the specified index.
 * 
 * Throws:
 * ------
 * IndexOutOfBoundsException - if index is negative 
 * or greater than or equal to length(). 
 */

public class CharAtDemo
{

    public static void main(String[] args)
    {

        StringBuilder sb = new StringBuilder("Welcome");

        char ch = sb.charAt(3);
        System.out.println("charAt(3) = " + ch);

        ch = sb.charAt(5);
        System.out.println("charAt(5) = " + ch);
    }
}
Output
charAt(3) = c
charAt(5) = m
Click the below link to download the code:
https://sites.google.com/site/javaee4321/java/StringBuilderDemo_charAt_App.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_charAt_App

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_charAt_App/?at=master

See also:

  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [subSequence(int start, int end) method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=yH3dqWFZ5WI&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [subSequence(int start, int end) method] 
    Java Tutorial : Java StringBuilder [subSequence(int start, int end) method] 
    Java Tutorial : Java StringBuilder [subSequence(int start, int end) method] 
    SubSequenceDemo.java
    /*
     * public CharSequence subSequence(int start, int end)
     * 
     * Parameters: 
     * ---------- 
     * start - the start index,inclusive.
     *  
     * end - the end index, exclusive.
     * 
     * Returns: 
     * ------- 
     * the specified subsequence.
     * 
     * Throws: 
     * ------ 
     * IndexOutOfBoundsException - if start or end 
     * are negative, if end is greater than length(),
     * or if start is greater than end.
     */
    public class SubSequenceDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Welcome");
            CharSequence charSequence = sb.subSequence(3, 6);
            String strValue = (String) charSequence;
            System.out.println("strValue = " + strValue);
    
        }
    }
    
    Output
    strValue = com
    
    
    
    Refer:
    https://docs.oracle.com/javase/8/docs/api/index.html?java/lang/CharSequence.html

    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_subSequence_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_subSequence_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_subSequence_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [substring method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=3EHxg-45eb4&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [substring method] 
    Java Tutorial : Java StringBuilder [substring method] 
    SubStringDemo1.java
    /*
     * public String substring(int start, int end)
     * 
     * Parameters: 
     * ---------- 
     * start - The beginning index,inclusive. 
     * 
     * end - The ending index, exclusive.
     * 
     * Returns: 
     * ------- 
     * The new string. 
     * 
     * Throws: 
     * ------
     * StringIndexOutOfBoundsException - if start or end are
     * negative or greater than length(), or start is
     * greater than end.
     */
    public class SubStringDemo1
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Welcome");
            String subString = sb.substring(3, 6);
            System.out.println("subString = " + subString);
        }
    }
    
    Output
    subString = com
    
    SubStringDemo2.java
    /*
     * public String substring(int start)
     * 
     * Parameters: 
     * ----------
     * start - The beginning index, inclusive.
     * 
     * Returns: 
     * -------
     * The new string.
     * 
     * Throws:
     * ------
     * StringIndexOutOfBoundsException - if start is less 
     * than zero, or greater than the length of this object.
     */
    
    public class SubStringDemo2
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Welcome");
            String subString = sb.substring(3);
            System.out.println("subString = " + subString);
    
        }
    }
    
    Output
    subString = come
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_substring_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_substring_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_substring_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [length() method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=aMOlLxjzPtI&list=UUhwKlOVR041tngjerWxVccw

    StringBuilderDemo.java
    /*
     * public int length()
     * 
     * Parameters: 
     * ----------
     * the length of the sequence of characters currently
     * represented by this object
     */
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder();
            System.out.println("sb = " + sb);
            System.out.println("length = " + sb.length());
    
            sb.append("Welcome");
            System.out.println("sb = " + sb);
            System.out.println("length = " + sb.length());
    
        }
    }
    
    Output
    sb = 
    length = 0
    sb = Welcome
    length = 7
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_length_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_length_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_length_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [ensureCapacity(int minimumCapacity) method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=t9cMM9g7ZSg&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [ensureCapacity(int minimumCapacity) method] 
    StringBuilderDemo.java
    /*
     * public void ensureCapacity(int minimumCapacity)
     * 
     * Parameters: 
     * ---------- 
     * minimumCapacity - the minimum desired capacity
     */
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder();
            // default 16
            System.out.println("Old capacity = "+sb.capacity());
    
            sb.ensureCapacity(40);
    
            System.out.println("New Capacity = "+sb.capacity());
        }
    }
    
    Output
    Old capacity = 16
    New Capacity = 40
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_ensureCapacity_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_ensureCapacity_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_ensureCapacity_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [capacity() method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=3N0rJ1Vknj0&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [capacity() method] 
    StringBuilderDemo.java
    /*
     * public int capacity()
     *  
     * Returns: 
     * -------- 
     * the current capacity
     */
    
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder();
            // default 16
            System.out.println(sb.capacity());
            sb.append("Hello");
            // now 16
            System.out.println(sb.capacity());
            sb.append("Hello peter welcome to India");
    
            // now (16*2)+2=34 i.e (oldcapacity*2)+2
            System.out.println(sb.capacity());
        }
    }
    
    Output
    16
    16
    34
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_capacity_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_capacity_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_capacity_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [deleteCharAt(int index) method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=AAwglHGQpbQ&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [deleteCharAt(int index) method] 
    Java Tutorial : Java StringBuilder [deleteCharAt(int index) method] 
    StringBuilderDemo.java
    /*
     * public StringBuilder deleteCharAt(int index)
     * 
     * Parameters: 
     * -----------
     * index - Index of char to remove
     * 
     * Returns:
     * --------
     * This object.
     * 
     * Throws:
     * -------
     * StringIndexOutOfBoundsException - if the index is negative 
     * or greater than or equal to length().
     * 
     */
    
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Welcome");
            System.out.println(sb);
            sb = sb.deleteCharAt(2);
            System.out.println(sb);
        }
    }
    
    Output
    Welcome
    Wecome
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_deleteCharAt_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_deleteCharAt_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_deleteCharAt_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [delete(int start,int end) method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=qtIA8OLLXbI&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [delete(int start,int end) method] 
    Java Tutorial : Java StringBuilder [delete(int start,int end) method] 
    StringBuilderDemo.java
    /*
     * public StringBuilder delete(int start, int end)
     * 
     * Parameters: 
     * -----------
     * start - The beginning index, inclusive. 
     * 
     * end - The ending index, exclusive.
     * 
     * Returns:
     * --------
     * This object.
     */
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Welcome");
            System.out.println(sb);
            sb = sb.delete(3, 6);
            System.out.println(sb);
        }
    }
    
    Output
    Welcome
    Wele
    
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_delete_str_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_delete_str_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_delete_str_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [reverse() method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=cFu9AOmDY5o&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [reverse() method] 
    StringBuilderDemo.java
    /*
     * public StringBuilder reverse()
     *  
     * Returns: 
     * -------- 
     * a reference to this object.
     */
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Hello");
            System.out.println(sb);
            sb = sb.reverse();
            System.out.println(sb);
        }
    }
    
    Output
    Hello
    olleH
    
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_reverse_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_reverse_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/4fb20859f2e7f390cc32dd6346f52d7d27c7a813/BasicJava/StringBuilderDemo_reverse_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [replace(int start,int end, String str) method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=b4qCUEj9EXY&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [replace(int start,int end, String str) method]


    StringBuilderDemo.java
    /*
     * public StringBuilder replace(int start, int end,
     *                                         String str)
     *        
     * Parameters: 
     * -----------   
     * start - The beginning index, inclusive.
     * 
     * end - The ending index, exclusive.
     * 
     * str - String that will replace previous contents.
     * 
     * Returns: 
     * -------- 
     * This object.
     * 
     * Throws:
     * -------
     * StringIndexOutOfBoundsException - if start is negative, 
     * greater than length(), or greater than end. 
     */
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Hello Dave Welcome");
            System.out.println(sb);
            sb = sb.replace(6, 10, "Peter");
            System.out.println(sb);
        }
    }
    
    Output
    Hello Dave Welcome
    Hello Peter Welcome
    
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_replace_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_replace_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/bb94d904a4b291ce0b8aeae9cc6d268e0b410985/BasicJava/StringBuilderDemo_replace_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Wednesday, 27 April 2016

    Java Tutorial : Java StringBuilder [insert methods]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=jsPkqqZTikY&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [insert methods] 
    StringBuilderDemo.java
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Hello  World");
            System.out.println(sb);
            int intValue = 100;
            sb.insert(6, intValue);
            System.out.println(sb);
        }
    }
    
    Output
    Hello  World
    Hello 100 World
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_insert_methods_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_insert_methods_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/ea6705eb8d861d880326570ef3992b3db7646c7d/BasicJava/StringBuilderDemo_insert_methods_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [insert(int offset,String str) method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=i6-sKDJlLDc&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [insert(int offset,String str) method]
    StringBuilderDemo.java
    /*
     * public StringBuilder insert(int offset, String str)
     *
     * Parameters:
     * ----------
     * offset - the offset.
     * 
     * str - a string.
     *
     * Returns:
     * -------
     * a reference to this object.
     */
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Hello  World");
            System.out.println(sb);
            String str = "My ";
            sb.insert(6, str);
            System.out.println(sb);
        }
    }
    
    Output
    Hello  World
    Hello My  World
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_insert_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_insert_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/ea6705eb8d861d880326570ef3992b3db7646c7d/BasicJava/StringBuilderDemo_insert_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Tuesday, 26 April 2016

    Java Tutorial : Java StringBuilder [append methods]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=__3MMbzdczc&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [append methods] 
    StringBuilderDemo.java
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Hello ");
            int intValue = 20;
            sb.append(intValue);
            double doubleValue = 500.4;
            sb.append(doubleValue);
            System.out.println(sb);
        }
    }
    
    Output
    Hello 20500.4
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_append_methods_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_append_methods_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/ea6705eb8d861d880326570ef3992b3db7646c7d/BasicJava/StringBuilderDemo_append_methods_App/?at=master

    See also:

  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [append(StringBuffer sb) method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=w6yxMaMmAWo&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [append(StringBuffer sb) method] 
    StringBuilderDemo.java
    /*
     * public StringBuilder append(StringBuffer sb)
     * 
     * Appends the specified StringBuffer to this sequence.
     * 
     * Parameters:
     * ----------   
     * sb - the StringBuffer to append.
     * 
     * Returns:
     * -------
     * a reference to this object.
     */
    
    
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder stringbuilder = new StringBuilder("Hello ");
            StringBuffer stringBuffer = new StringBuffer("Java");
            stringbuilder.append(stringBuffer);
            System.out.println(stringbuilder);
        }
    }
    
    Output
    Hello Java
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_append_sb_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_append_sb_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/ea6705eb8d861d880326570ef3992b3db7646c7d/BasicJava/StringBuilderDemo_append_sb_App/?at=master

    See also:

  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Java Tutorial : Java StringBuilder [append(String str) method]


    Click here to watch in Youtube :
    https://www.youtube.com/watch?v=RFeT4FNxU_w&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge
    Java Tutorial : Java StringBuilder [append(String str) method] 
    StringBuilderDemo.java
    /*
     * public StringBuilder append(String str)
     *
     * Parameters:
     * ----------
     * str - a string.
     *
     * Returns:
     * -------
     * a reference to this object.
     */
    
    public class StringBuilderDemo
    {
    
        public static void main(String[] args)
        {
            StringBuilder sb = new StringBuilder("Hello ");
            System.out.println(sb);
            sb.append("Java");
            System.out.println(sb);
        }
    }
    
    Output
    Hello 
    Hello Java
    
    Click the below link to download the code:
    https://sites.google.com/site/javaee4321/java/StringBuilderDemo_append_str_App.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_append_str_App

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java/src/ea6705eb8d861d880326570ef3992b3db7646c7d/BasicJava/StringBuilderDemo_append_str_App/?at=master

    See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial