Builtin Java Classes (Lecture 8)
Builtin Java Classes (Lecture 8)
Transcendental Functions:
Exponential Functions:
Rounding Functions:
a) String Literal:
Simple string enclosed in double quotes “ ”.
For instance:
String str = “HELLO”; //string object using a string literal
String str2 = str;
a) concat method
b) + operator
a) equals() method
Compares the content of two strings for equality.
Syntax :
b) == operator
Compares two object references whether they refer to the same instance.
c) CompareTo() method
substring(int begin) Returns a part of a string from the specified starting point to the
end point of the original string.
substring(int begin, int end) Returns a part of a string from the specified starting point to the
specified end point of the original string.
tolowercase() Converts all the characters of a string to lowercase.
touppercase() Converts all the characters of a string to uppercase.
append(string str)
append(int r)
append(object obj)
First parameter mentions the index from which position the string would
be inserted in the stringbuffer object.
Second parameter indicates the string representation to be inserted in the
string buffer object.
replace():
Replaces the string from the specified start index to the end index.
capacity():
Returns the current capacity of a string buffer object.
ensurecapacity():
Used to ensure minimum capacity of a string buffer object.