Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Module 3

This document covers string handling in Java, explaining that strings are objects rather than arrays of characters. It details various constructors for creating strings, methods for string manipulation, and comparison techniques, including equals() and regionMatches(). Additionally, it discusses string operations such as concatenation, character extraction, and conversion to character arrays.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Module 3

This document covers string handling in Java, explaining that strings are objects rather than arrays of characters. It details various constructors for creating strings, methods for string manipulation, and comparison techniques, including equals() and regionMatches(). Additionally, it discusses string operations such as concatenation, character extraction, and conversion to character arrays.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Advanced Java & J2EE 22MCA341

Module - 3
String Handling
• One of the most important of Java’s data type is String.

• String defines and supports character strings.

• In many other programming languages a string is an array of


characters. But in java, strings are objects.

The String Constructors

• The String class supports several constructors. To create an empty


String, you call the default

• constructor.

• For example,

String s = new String();

• will create an instance of String with no characters in it.

• Frequently, you will want to create strings that have initial values.

• The String class provides a variety of constructors to handle this.

• To create a String initialized by an array of characters, use the


constructor shown here:

String(char chars[ ])

• Here is an example:

class stringexample

public static void main(String args[])

char[] chars={'a','b','c','d','e','f','g','f','i','j'};

String s=new String(chars);

System.out.println(s);

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 1


Advanced Java & J2EE 22MCA341

• You can specify a subrange of a character array as an initializer using


the following constructor:

String(char chars[ ], int startIndex, int numChars)

• Here, startIndex specifies the index at which the subrange begins,


and numChars specifies the number of characters to use.

class stringexample1

public static void main(String args[])

char chars[]={'a','b','c','d','e','f','g','f','i','j'};

String s=new String(chars, 2,3);

System.out.println(s);

• You can construct a String object that contains the same character
sequence as another

• String object using this constructor:

String(String strObj)

• Here, strObj is a String object.

• Consider this example:

class MakeString

public static void main(String args[])

char c[] = {'J', 'a', 'v', 'a'};

String s1 = new String(c);

String s2 = new String(s1);

System.out.println(s1);

System.out.println(s2);

}}

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 2


Advanced Java & J2EE 22MCA341

• String class provides constructors that initialize a string when given a


byte array.

• Their forms are shown here:

String(byte asciiChars[ ])

String(byte asciiChars[ ], int startIndex, int numChars)

• Here, asciiChars specifies the array of bytes.

• The second form allows you to specify a subrange.

• In each of these constructors, the byte-to-character conversion is


done by using the default character encoding of the platform.

class SubStringCons

public static void main(String args[])

byte ascii[] = {65, 66, 67, 68, 69, 70 };

String s1 = new String(ascii);

System.out.println(s1);

String s2 = new String(ascii, 2, 3);

System.out.println(s2);

}}

• This program generates the following output:

ABCDEF

CDE

String Length

• The length of a string is the number of characters that it contains.

• To obtain this value, call the length( ) method.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 3


Advanced Java & J2EE 22MCA341

int length( )

• EX:

char chars[] = { 'a', 'b', 'c' };

String s = new String(chars);

System.out.println(s.length()); //3

Special String Operations

1.String Literals

• The earlier examples showed how to explicitly create a String instance


from an array of characters by using the new operator.

• However, there is an easier way to do this using a string literal.

• For each string literal in your program, Java automatically constructs


a String object.

• Thus, you can use a string literal to initialize a String object.

• For example, the following code fragment creates two equivalent


strings:

char chars[] = { 'a', 'b', 'c' };

String s1 = new String(chars);

String s2 = "abc"; // use string literal

• Because a String object is created for every string literal, you can use
a string literal any place you can use a String object.

• For example, you can call methods directly on a quoted string as if it


were an object reference, as the following statement shows.

System.out.println("abc".length());

2.String Concatenation

• In general, Java does not allow operators to be applied to String


objects.

• The one exception to this rule is the + operator, which concatenates


two strings, producing a String object as the result.

• This allows you to chain together a series of + operations.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 4


Advanced Java & J2EE 22MCA341

EX:

String age = "9";

String s = "He is " + age + " years old.";

System.out.println(s);

3.String Concatenation with Other Data Types

• You can concatenate strings with other types of data.

• For example,

int age = 9;

String s = "He is " + age + " years old.";

System.out.println(s);

• In this case, age is an int rather than another String, but the output
produced is the same as before.

• This is because the int value in age is automatically converted into its
string representation within a String object.

• This string is then concatenated as before.

Example

class Sub

public static void main(String args[])

String a = "four: " + 2 + 2;

String b = "four: " + ( 2 + 2);

System.out.println(a);

System.out.println(b);

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 5


Advanced Java & J2EE 22MCA341

4.String Conversion and toString( )

• The toString() method returns the string representation of the object.

String toString( )

EX:

class Box

double width;

double height;

double depth;

Box(double w, double h, double d)

width = w;

height = h;

depth = d;

public String toString()

return "Dimensions are " + width + " by " +

depth + " by " + height + ".";

}}

class toStringDemo

public static void main(String args[])

Box b = new Box(10, 12, 14);

String s = "Box b: " + b;

System.out.println(b);

System.out.println(s);

}}

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 6


Advanced Java & J2EE 22MCA341

Output

• D:\ec>javac toStringDemo.java

• D:\ec>java toStringDemo

• Dimensions are 10.0 by 14.0 by 12.0.

• Box b: Dimensions are 10.0 by 14.0 by 12.0.

Character Extraction

• The String class provides a number of ways in which characters can


be extracted from a String object.

1.charAt():

• The java string charAt() method returns a char value at the


given index number. The index number starts from 0.

• The general form is,

char charAt(int index)

index : index number, starts with 0

EX:

class charat{

public static void main(String args[]) {

char ch;

ch = "rnsit".charAt(1);

System.out.println(ch);

}}

2.getChar():

• If you need to obtain more than one character at a time, you can
use the getChar() method.

• The general form is

void getChars(int srcBegin, int srcEnd, char[] dest, int destBegin)

• srcBegin -- index of the first character in the string to copy.

• srcEnd -- index after the last character in the string to copy.

• dest -- the destination array.

• dstBegin -- the start offset in the destination array.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 7


Advanced Java & J2EE 22MCA341

class getCharsDemo

public static void main(String args[])

String s = "This is a demo of the getChars method.";

int start = 10;

int end = 14;

char buf[] = new char[5];

s.getChars(start, end, buf, 0);

System.out.println(buf); }}

• Here is the output of this program:

demo

3.toCharArray():

• If you want to convert all the characters in a String object into a


character array,the easiest way is to call toCharArray().

• It returns an array of characters for the entire string.

• It general form is,

• char[] toCharArray()

• Ex:

class Chararray {

public static void main(String[] args)

String str="java programming";

char[] chrs=str.toCharArray();

System.out.println(chrs);

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 8


Advanced Java & J2EE 22MCA341

4.getBytes( )

• There is an alternative to getChars( ) that stores the characters in an


array of bytes.

• This method is called getBytes( ), and it uses the default character-


to-byte conversions provided by the platform.

• Here is its simplest form:

byte[ ] getBytes( )

• EX:

public class StringGet

public static void main(String args[])

String s1="ABCDEFG";

byte[] barr=s1.getBytes();

for(int i=0;i<barr.length;i++)

System.out.print(barr[i]+ “ “);

OUTPUT

65 66 67 68 69 70 71

String comparison methods:


• The String class includes a number of methods that
compare strings or substrings within strings.
1.equals() and equalsIgnoreCase()
2.equals() Versus ==
3.startsWith() and endsWith()

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 9


Advanced Java & J2EE 22MCA341

4.regionMatches()
5.compareTo() and compareToIgnoreCase()

i. equals() and equalsIgnoreCase():


• To compare two strings for equality, use equals()
• The general form is
boolean equals(Object str)
• here, str is the object compared with the invoking String
object.
• If any character is not matched, it returns false. If all
characters are matched, it returns true.
• The comparison between two strings are case sensitive.
• To perform a case-insensitive comparison (that is, a
comparison that ignores differences in the case of the
characters), call equalsIgnoreCase().
• When it compares two strings,it considers A-Z to be the
same as a-z.
boolean equalsIgnoreCase(String str)
class EqualityDemo
{
public static void main(String[] args)
{
String str1 = "table";
String str2 = "table";
String str3 = "chair";
String str4 = "TABLE";
System.out.println(str1.equals(str2));

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 10


Advanced Java & J2EE 22MCA341

System.out.println(str1.equals(str3));
System.out.println(str1.equalsIgnoreCase(str4));
}
}

ii. equals() Verses== operator:


it is important to emphasize that the equals() method and
the == operator perform two different operations.
• The equals() compares the characters inside the string
object.
• The == operator compares two object references to see
whether they refer to the same instance.
• Ex:

public class mca30 {


public static void main(String[] args)
{
String s1 = new String("HELLO");
String s2 = new String("HELLO");
System.out.println(s1 == s2);
System.out.println(s1.equals(s2));
String s3=s1;
System.out.println(s1 == s3);
}
}

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 11


Advanced Java & J2EE 22MCA341

Output
D:\ec>java Test
false
true
true

iii. startsWith() and endsWith():


• The startsWith() method determines whether a given String
begins with a specified string.
• The endsWith() determines whether a given Strings ends
with a specified string.
• The general form is
boolean startsWith(String str)
boolean endsWith(String str)
• Here, str is the string being tested. In the case of
startsWith(), if the str matches the beginning of the
invoking string, true is returned.
• In the case of endsWith(), if the str matches the end of the
invoking string, true is returned.

import java.io.*;
class mca311
{
public static void main(String args[])
{
String Str = new String("Welcome to rnsit");

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 12


Advanced Java & J2EE 22MCA341

System.out.println("Return Value :"


+Str.startsWith("Welcome") );
System.out.println("Return Value :"+Str.endsWith("rnsit") );
System.out.println("Return
Value:"+Str.startsWith("Tutorials") );
}
}

iv. regionMatches():
• The regionMatches() method compares a subset of a string
with a subset of another string.
• The general form is,
• boolean regionMatches(int startIndex,String
str2,int str2StartIndex ,int numChrs);
• boolean regionMatches(boolean ignoreCase, int
startIndex,String str2,int str2StartIndex ,int numChrs);
• For both versions, startIndex specifies the index at which
the region to compare begins within the invoking String
object.
• The String being compared is specified by str2.
• The index at which the comparison will start within str2 is
specified by str2StartIndex.
• The length of the region being compared is passed in
numChrs.
• The first version is case sensitive.
• In the second version, if ignoreCase is true, the case of the
Characters is ignored.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 13


Advanced Java & J2EE 22MCA341

Ex:1
class CompareRegions
{
public static void main(String[] args)
{
String str1 = "rnsit in bangalore";
String str2 = "bangalore channasandra rnsit";
System.out.println(str1.regionMatches(0, str2, 23, 3));
}
}

Ex:2
class CompareRegions2
{
public static void main(String[] args)
{
String str1 = "rnsit in bangalore";
String str2 = "bangalore channasandra RNSit";
if(str1.regionMatches(true,0, str2, 23, 3))
System.out.println("Regions match");
else
System.out.println("Regions unmatch");
}
}

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 14


Advanced Java & J2EE 22MCA341

v. compareTo()
• The java string compareTo() method compares the given
string with current string lexicographically.
• It returns positive number, negative number or 0.
• It compares strings on the basis of Unicode value of each
character in the strings.
• if s1 > s2, it returns positive number
• if s1 < s2, it returns negative number
• if s1 == s2, it returns 0
EX:
public class Test26
{
public static void main(String args[])
{
String s1="hello";
String s2="hello";
String s3="meklo";
String s4="flag";
System.out.println(s1.compareTo(s2));
//0 because both are equal
System.out.println(s1.compareTo(s3));
//-5 because "h" is 5 times lower than "m"
System.out.println(s1.compareTo(s4));
//2 because "h" is 2 times greater than "f“
}
}

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 15


Advanced Java & J2EE 22MCA341

compareToIgnoreCase()
• This method compares two strings lexicographically,
ignoring case differences.
Example
public class Test25
{
public static void main(String args[])
{
String str1 = "rnsit";
String str2 = "Rnsit";
String str3 = "mca";
System.out.println(str1.compareToIgnoreCase( str2 ));
System.out.println(str2.compareToIgnoreCase( str3 ));
System.out.println(str3.compareToIgnoreCase( str1 ));
}
}

Searching Strings
• The String class provides two methods that allow you to
search a string for a specified character or substring:
indexOf( )
lastIndexOf( )
• indexOf( ) Searches for the first occurrence of a character
or substring.
• lastIndexOf( ) Searches for the last occurrence of a
character or substring.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 16


Advanced Java & J2EE 22MCA341

• In all cases, the methods return the index at which the


character or substring was found, or –1 on failure.
EX:
class test27
{
public static void main(String[] args)
{
String str1 = “Introduction to Java”;
String str2 = new String(str1);
int idx = str2.indexOf(“I");
System.out.println("Index of first occurrence of I is: " + idx);
idx = str2.lastIndexOf(“o");
System.out.println("Index of last occurrence of O is: "
+ idx);
}
}

Modifying a String
1.substring
• The substring() method returns a new string that contains a
specified portion of the invoking string.
• The form of substring() is
String substring(int startIndex)
String substring(int startIndex,int endIndex);
• Here, startIndex specifies the beginning index and
• endIndex specifies the stopping point.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 17


Advanced Java & J2EE 22MCA341

• The string returned contains all the characters from the


beginning index to the ending index.
Ex:
class SubStr
{
public static void main(String[] args)
{
String orgstr = "Java makes the Web move.";
String k= orgstr.substring(10);
String substr = orgstr.substring(5, 18);
System.out.println(k);
System.out.println("substr: " + substr);
}
}
Output
D:\ec>java SubStr
the Web move.
subsr: makes the Web

2.concat
• The String concat() method concatenates the specified
string to the end of current string.
Ex:
class TestStringConcatenation3
{
public static void main(String args[])

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 18


Advanced Java & J2EE 22MCA341

{
String s1="Sachin ";
String s2="Tendulkar";
String s3=s1.concat(s2);
System.out.println(s3); //SachinTendulkar
}
}

3.replace( )
• The replace( ) method has two forms.
• The first replaces all occurrences of one character in the
invoking string with another character.
• It has the following general form:
String replace(char original, char replacement)
• The second form of replace( ) replaces one character
sequence with another.
• It has this general form:
String replace(CharSequence original, CharSequence
replacement)

EX:
public class Replace
{
public static void main(String[] args)
{
String str = "hello hai";
String rs = str.replace("h","s");

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 19


Advanced Java & J2EE 22MCA341

System.out.println(rs);
rs = rs.replace("s","h");
System.out.println(rs);
}
}

Example2
public class Replace2
{
public static void main(String args[])
{
String s1="mca mba ec java";
String replaceString=s1.replace("mba","puc");
System.out.println(replaceString);
}
}

• replace( ) : StringBuffer replace(int startIndex, int


endIndex, String str)
• The replace() method replaces the given string from the
specified beginIndex and endIndex.
public class Replace1
{
public static void main(String args[])
{
StringBuffer sb = new StringBuffer("abcdefghijk");

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 20


Advanced Java & J2EE 22MCA341

sb.replace(3, 6, “JAVA");
System.out.println(sb);
}
}

4.trim( )
• The trim( ) method returns a copy of the invoking string
from which any leading and trailing whitespace has been
removed.
• It has this general form:
String trim( )
Example
public class trim1
{
public static void main(String args[])
{
String s = " Hello World ".trim();
System.out.println(s);
}
}

Changing the Case of Characters Within a String


• The method toLowerCase( ) converts all the characters in a
string from uppercase to lowercase.
• The toUpperCase( ) method converts all the characters in a
string from lowercase to uppercase.
• Nonalphabetical characters, such as digits, are unaffected.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 21


Advanced Java & J2EE 22MCA341

• Here are the general forms of these methods:


String toLowerCase( )
String toUpperCase( )

EX:
class ChangeCase
{
public static void main(String args[])
{
String s = "This is a test.";
System.out.println("Original: " + s);
String upper = s.toUpperCase();
String lower = s.toLowerCase();
System.out.println("Uppercase: " + upper);
System.out.println("Lowercase: " + lower);
}
}

Data Conversion Using valueOf( )


• The valueOf( ) method converts data from its internal
format into a human-readable form.
• It is a static method that is overloaded within String for all
of Java’s built-in types so that each type can be converted
properly into a string.
• valueOf( ) is also overloaded for type Object, so an object of
any class type you create can also be used as an argument.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 22


Advanced Java & J2EE 22MCA341

static String valueOf(double num)


static String valueOf(long num)
static String valueOf(Object ob)
static String valueOf(char chars[ ])

Additional String Methods

StringBuffer
• Java StringBuffer class is used to created mutable
(modifiable) string.
• The StringBuffer class in java is same as String class
except it is mutable i.e. it can be changed.
• A string that can be modified or changed is known as
mutable string.
• StringBuffer and StringBuilder classes are used for creating
mutable string.
• StringBuffer Constructors

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 23


Advanced Java & J2EE 22MCA341

• StringBuffer defines these four constructors:


StringBuffer( )
StringBuffer(int size)
StringBuffer(String str)
StringBuffer(CharSequence chars)
• Important methods of StringBuffer class

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 24


Advanced Java & J2EE 22MCA341

• capacity() method returns the current capacity.


• The capacity is the amount of storage available for newly
inserted characters, beyond which an allocation will occur.
• In simple words, the default storage of an empty
StringBuffer has a 16-character capacity.
• So, when some characters are already inserted, the method
returns the number-of-existing-characters+16 as the
output.
• Therefore, it goes beyond the allocation limit.
Example
public class capacity
{
public static void main(String[] args)
{
StringBuffer buff = new StringBuffer();
System.out.println("capacity = " + buff.capacity()); //16
buff = new StringBuffer("BANGALORE");
System.out.println("capacity = " + buff.capacity()); //25
}
}

• setLength
• The setLength(int newLength) method of StringBuffer
class is the inbuilt method used to set the length of the
character sequence equal to newLength.
• If the newLength passed as argument is less than the old
length, the old length is changed to the newLength.

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 25


Advanced Java & J2EE 22MCA341

• If the newLength passed as argument is greater than or


equal to the old length, null characters (‘\u0000’) are
appended at the end of old sequence so that length becomes
the newLength argument.

class GFG2
{
public static void main(String[] args)
{
StringBuffer str = new StringBuffer("Welcome to rnsit");
System.out.println("String length = " + str.length() + " and
contains = " + str);
str.setLength(12);
System.out.println("After setLength() String = "+
str.toString());
}
}

charAt( ) : char charAt(int where)


setCharAt( ) : void setCharAt(int where, char ch)
EX:
class rnsit35
{
public static void main(String args[])
{
StringBuffer str = new StringBuffer("RNSIT");
str.setCharAt(3, 'L');

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 26


Advanced Java & J2EE 22MCA341

System.out.println("After Set, string = " + str);


}
}

append( ):
• the append() method of StringBuilder class is used to add
data to the end of an existing StringBuilder object.
EX:
class append10
{
public static void main(String args[])
{
StringBuffer sb=new StringBuffer("Hello ");
sb.append("Java");//now original string is changed
System.out.println(sb);//prints HelloJava
}
}

insert( ):
• The insert() method inserts the given string with this string
at the given position.
EX:
class insert10
{
public static void main(String args[])
{

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 27


Advanced Java & J2EE 22MCA341

StringBuffer sb=new StringBuffer("Hello");


sb.insert(1,"Java");//now original string is changed
System.out.println(sb);//prints HJavaello
}
}

reverse()
• The reverse() method of StringBuilder class reverses the
current string.
EX:
public class reverse10
{
public static void main(String args[])
{
StringBuffer sbf = new StringBuffer("RNSIT");
System.out.println("String buffer = " + sbf);
sbf.reverse();
System.out.println("String buffer after reversing = " + sbf);
}
}

delete() Method
• The delete() method of StringBuffer class deletes the string
from the specified beginIndex to endIndex.
public class delete10
{

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 28


Advanced Java & J2EE 22MCA341

public static void main(String[] args)


{
StringBuffer sbf = new StringBuffer("rnsit bangalore");
System.out.println("string buffer = " + sbf);
sbf.delete(2, 8);
System.out.println("After deletion string buffer is = " + sbf);
}
} // rnngalore

deleteCharAt()
• method removes the char at the specified position in this
sequence.
public class delete11
{
public static void main(String[] args)
{
StringBuffer buff = new StringBuffer("Java lang");
System.out.println("buffer = " + buff);
buff.deleteCharAt(2);
System.out.println("After deletion = " + buff);
}
}

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 29


Advanced Java & J2EE 22MCA341

substring( )
• In StringBuffer class, there are two types of substring
method depending upon the parameters passed to it.
• The substring(int start) method of StringBuffer class is
the inbuilt method used to return a substring start from
index start and extends to end of this sequence.
• The string returned by this method contains all character
from index start to end of the old sequence.
• The substring(int start, int end) method of StringBuffer
class is the inbuilt method used to return a substring start
from index start and extends to the index end-1 of this
sequence.

Example
class substring
{
public static void main(String[] args)
{
StringBuffer str= new StringBuffer("bangalorernsit");
System.out.println("String contains = " + str);
System.out.println("SubSequence = " + str.substring(5));
System.out.println("SubSequence = " + str.substring(5, 8));
}
}

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 30


Advanced Java & J2EE 22MCA341

Additional StringBuffer Methods

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 31


Advanced Java & J2EE 22MCA341

StringBuilder
• Java StringBuilder class is used to create mutable
(modifiable) string.
• The Java StringBuilder class is same as StringBuffer class
except that it is non-synchronized,which means that it is
not thread-safe.
• The advantage of StringBuilder is faster performance.
• However, in cases in which you are using multithreading,
you must use StringBuffer rather than StringBuilder.
• . It is available since JDK 1.5.
Ex:
• stringbuffer methods

Mr. Raghu Prasad K, Assistant Professor, MCA Dept | RNSIT Page 32

You might also like