SlideShare une entreprise Scribd logo
1  sur  23
TEST (MODULE:- 1 and 2)
 What are command line arguments? Write a program in JAVA to print

  Fibonacci series using command line arguments?      [10]

 Create a class employee with data members empid, empname, designation

  and salary. Write methods for:-                     [10]

  get_employee()- To take user input.

  show_grade()- To display grade of employee based on salary.

  show_employee()- To show employee details.

 Write a note on:-                                   [10]
   Java Virtual Machine.

   Nesting of Methods with example
STRINGS
   IN
 JAVA
          - Ankita Karia
STRINGS
 Strings represent a sequence of characters.
 The easiest way to represent a sequence of characters in
  JAVA is by using a character array.
 char Array[ ] = new char [5];             Character arrays are
                                              not good enough to
                                             support the range of
                                             operations we want to
                                              perform on strings.


    In JAVA strings are class objects and implemented using
    two classes:-
        String
        StringBuffer.
    In JAVA strings are not a character array and is not NULL
    terminated.
DECLARING & INITIALISING

•   Normally, objects in Java are created with the new keyword.

    String name;
     name = new String("Craig");

                                OR
     String name= new String("Craig");


•   However, String objects can be created "implicitly":
                 String name;
                 name = "Craig";
The String Class


String objects are handled specially by the compiler.
 String is the only class which has "implicit" instantiation.
The String class is defined in the java.lang package.
Strings are immutable.
 The value of a String object can never be changed.
 For mutable Strings, use the StringBuffer class.
DYNAMIC INITIALIZATION
           OF STRINGS
BufferedReader br = new BufferedReader(new
 InputStreamReader(System.in));

    String city = br.readLine();    Give throws
                                    IOException
                                       beside
                                      function
                                        name

Scanner sc=new Scanner(System.in);
    String state=sc.nextLine();
   String state1=sc.next();
STRING CONCATENATION
    JAVA string can be concatenated
     using + operator.
 String name="Ankita";
 String surname="Karia";
 System.out.println(name+" "+surname);

STRING Arrays
•An array of strings can also be created
        String cities [ ] = new String[5];
• Will create an array of CITIES of size 5 to
hold string constants
String Methods
   The String class contains many useful methods for string-
    processing applications.
    ◦ A String method is called by writing a String object, a dot, the name of
      the method, and a pair of parentheses to enclose any arguments

    ◦ If a String method returns a value, then it can be placed anywhere that a
      value of its type can be used

      String greeting = "Hello";         String method
      int count = greeting.length();
      System.out.println("Length is " + greeting.length());

    ◦ Always count from zero when referring to the position or index of a
      character in a string
String Indexes
Some Methods in the Class String (Part 1
of 8)




                        1-10
Some Methods in the Class String (Part 2
of 8)
Some Methods in the Class String (Part 3
of 8)
Some Methods in the Class String (Part 4 o
8)
Some Methods in the Class String (Part 5 o
8)
Some Methods in the Class String (Part 6
of 8)
Some Methods in the Class String (Part 7 o
STRING BUFFER

               CLASS
    STRINGBUFFER class creates strings flexible length that
    can be modified in terms of both length and content.

   STRINGBUFFER may have characters and substrings
    inserted in the middle or appended to the end.

   STRINGBUFFER automatically grows to make room for
    such additions

                      Actually STRINGBUFFER has more
                     characters pre allocated than are actually
                        needed, to allow room for growth
STRING BUFFER
              CONSTRUCTORS
   String Buffer():- Reserves room fro 16 characters
    without reallocation


   StringBuffer(int size):- Accepts an integer argunent
    that explicilty sets the size of the buffer


   StringBuffer(String str):- Accepts STRING argument
    that sets the initial contents of the STRINGBUFFER and
    allocated room for 16 additional characters.
STRING BUFFER FUNCTIONS
   length():-Returns the current length of the string.

   capacity():- Returns the total allocated capacity.

   void ensureCapacity():- Preallocates room for a certain

                    number of characters.
   void setLength(int len):- Sets the length of the string s1
                              to len.
               If len<s1.length(), s1 is truncated.
               If len>s1.length(), zeros are added to s1.
   charAt(int where):- Extracts value of a single character.

   setCharAt(int where, char ch):- Sets the value of character

                     at specified position.
STRING BUFFER FUNCTIONS
   append(s2):- Appends string s2 to s1 at the end.

   insert(n,s2 ):- Inserts the string s2 at the position n of the
    string s1

   reverse():- Returns the reversed object on when it is called.

   delete(int n1,int n2):- Deletes a sequence of characters
    from the invoking object.

                 n1      Specifies index of first character to remove

                          Specifies index one past the lastcharacter to
                  n2      remove

   deleteCharAt(int loc):- Deletes the character at the index
    specified by loc.
STRING BUFFER FUNCTIONS
   replace(int n1,int n2,String s1):- Replaces one set of
    characters with another set.

   substring(int startIndex):- Returns the substring that starts
    at starts at startIndex and runs to the end.

   substring(int startIndex, int endIndex):- Returns the
    substring that starts at starts at startIndex and runs to the
    endIndex-1




VECTOR

Contenu connexe

Tendances

Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair
 
String handling(string class)
String handling(string class)String handling(string class)
String handling(string class)
Ravi_Kant_Sahu
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
topu93
 

Tendances (20)

Java Strings
Java StringsJava Strings
Java Strings
 
Java constructors
Java constructorsJava constructors
Java constructors
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
 
Method overriding
Method overridingMethod overriding
Method overriding
 
String in java
String in javaString in java
String in java
 
OOP java
OOP javaOOP java
OOP java
 
Interface in java
Interface in javaInterface in java
Interface in java
 
Data types in java
Data types in javaData types in java
Data types in java
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Generics in java
Generics in javaGenerics in java
Generics in java
 
This keyword in java
This keyword in javaThis keyword in java
This keyword in java
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
String handling(string class)
String handling(string class)String handling(string class)
String handling(string class)
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
 
Method overloading
Method overloadingMethod overloading
Method overloading
 

En vedette

String Handling in c++
String Handling in c++String Handling in c++
String Handling in c++
Fahim Adil
 
String classes and its methods.20
String classes and its methods.20String classes and its methods.20
String classes and its methods.20
myrajendra
 

En vedette (20)

Java String
Java String Java String
Java String
 
String Handling
String HandlingString Handling
String Handling
 
Introduction to Java Strings, By Kavita Ganesan
Introduction to Java Strings, By Kavita GanesanIntroduction to Java Strings, By Kavita Ganesan
Introduction to Java Strings, By Kavita Ganesan
 
Java strings
Java   stringsJava   strings
Java strings
 
Strings
StringsStrings
Strings
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
String java
String javaString java
String java
 
String Handling in c++
String Handling in c++String Handling in c++
String Handling in c++
 
Java multi threading
Java multi threadingJava multi threading
Java multi threading
 
Chapter 3:Programming with Java Operators and Strings
Chapter 3:Programming with Java Operators and  StringsChapter 3:Programming with Java Operators and  Strings
Chapter 3:Programming with Java Operators and Strings
 
String classes and its methods.20
String classes and its methods.20String classes and its methods.20
String classes and its methods.20
 
StringTokenizer in java
StringTokenizer in javaStringTokenizer in java
StringTokenizer in java
 
Strings and common operations
Strings and common operationsStrings and common operations
Strings and common operations
 
Java: strings e arrays
Java: strings e arraysJava: strings e arrays
Java: strings e arrays
 
Final keyword in java
Final keyword in javaFinal keyword in java
Final keyword in java
 
Save Time, Money and Bloodshed with Soft System Discovery
Save Time, Money and Bloodshed with Soft System DiscoverySave Time, Money and Bloodshed with Soft System Discovery
Save Time, Money and Bloodshed with Soft System Discovery
 
L21 io streams
L21 io streamsL21 io streams
L21 io streams
 
Ppt on this and super keyword
Ppt on this and super keywordPpt on this and super keyword
Ppt on this and super keyword
 
L13 string handling(string class)
L13 string handling(string class)L13 string handling(string class)
L13 string handling(string class)
 
String operation
String operationString operation
String operation
 

Similaire à Strings in Java

javastringexample problems using string class
javastringexample problems using string classjavastringexample problems using string class
javastringexample problems using string class
fedcoordinator
 
Strings Arrays
Strings ArraysStrings Arrays
Strings Arrays
phanleson
 

Similaire à Strings in Java (20)

javastringexample problems using string class
javastringexample problems using string classjavastringexample problems using string class
javastringexample problems using string class
 
String Handling, Inheritance, Packages and Interfaces
String Handling, Inheritance, Packages and InterfacesString Handling, Inheritance, Packages and Interfaces
String Handling, Inheritance, Packages and Interfaces
 
07slide
07slide07slide
07slide
 
Module-1 Strings Handling.ppt.pdf
Module-1 Strings Handling.ppt.pdfModule-1 Strings Handling.ppt.pdf
Module-1 Strings Handling.ppt.pdf
 
Day_5.1.pptx
Day_5.1.pptxDay_5.1.pptx
Day_5.1.pptx
 
StringBuffer.pptx
StringBuffer.pptxStringBuffer.pptx
StringBuffer.pptx
 
Java String Handling
Java String HandlingJava String Handling
Java String Handling
 
package
packagepackage
package
 
L14 string handling(string buffer class)
L14 string handling(string buffer class)L14 string handling(string buffer class)
L14 string handling(string buffer class)
 
String handling
String handlingString handling
String handling
 
Strings Arrays
Strings ArraysStrings Arrays
Strings Arrays
 
In the given example only one object will be created. Firstly JVM will not fi...
In the given example only one object will be created. Firstly JVM will not fi...In the given example only one object will be created. Firstly JVM will not fi...
In the given example only one object will be created. Firstly JVM will not fi...
 
Java
JavaJava
Java
 
Chapter 7 String
Chapter 7 StringChapter 7 String
Chapter 7 String
 
Java R20 - UNIT-5.pdf
Java R20 - UNIT-5.pdfJava R20 - UNIT-5.pdf
Java R20 - UNIT-5.pdf
 
Java R20 - UNIT-5.docx
Java R20 - UNIT-5.docxJava R20 - UNIT-5.docx
Java R20 - UNIT-5.docx
 
Strings in c++
Strings in c++Strings in c++
Strings in c++
 
Strings in c
Strings in cStrings in c
Strings in c
 
3.7_StringBuilder.pdf
3.7_StringBuilder.pdf3.7_StringBuilder.pdf
3.7_StringBuilder.pdf
 
M C6java7
M C6java7M C6java7
M C6java7
 

Plus de Abhilash Nair (20)

Sequential Circuits - Flip Flops
Sequential Circuits - Flip FlopsSequential Circuits - Flip Flops
Sequential Circuits - Flip Flops
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
 
Designing Clocked Synchronous State Machine
Designing Clocked Synchronous State MachineDesigning Clocked Synchronous State Machine
Designing Clocked Synchronous State Machine
 
MSI Shift Registers
MSI Shift RegistersMSI Shift Registers
MSI Shift Registers
 
VHDL - Enumerated Types (Part 3)
VHDL - Enumerated Types (Part 3)VHDL - Enumerated Types (Part 3)
VHDL - Enumerated Types (Part 3)
 
VHDL - Part 2
VHDL - Part 2VHDL - Part 2
VHDL - Part 2
 
Introduction to VHDL - Part 1
Introduction to VHDL - Part 1Introduction to VHDL - Part 1
Introduction to VHDL - Part 1
 
Feedback Sequential Circuits
Feedback Sequential CircuitsFeedback Sequential Circuits
Feedback Sequential Circuits
 
Designing State Machine
Designing State MachineDesigning State Machine
Designing State Machine
 
State Machine Design and Synthesis
State Machine Design and SynthesisState Machine Design and Synthesis
State Machine Design and Synthesis
 
Synchronous design process
Synchronous design processSynchronous design process
Synchronous design process
 
Analysis of state machines & Conversion of models
Analysis of state machines & Conversion of modelsAnalysis of state machines & Conversion of models
Analysis of state machines & Conversion of models
 
Analysis of state machines
Analysis of state machinesAnalysis of state machines
Analysis of state machines
 
Sequential Circuits - Flip Flops (Part 2)
Sequential Circuits - Flip Flops (Part 2)Sequential Circuits - Flip Flops (Part 2)
Sequential Circuits - Flip Flops (Part 2)
 
Sequential Circuits - Flip Flops (Part 1)
Sequential Circuits - Flip Flops (Part 1)Sequential Circuits - Flip Flops (Part 1)
Sequential Circuits - Flip Flops (Part 1)
 
FPGA
FPGAFPGA
FPGA
 
FPLDs
FPLDsFPLDs
FPLDs
 
CPLDs
CPLDsCPLDs
CPLDs
 
CPLD & FPLD
CPLD & FPLDCPLD & FPLD
CPLD & FPLD
 
CPLDs
CPLDsCPLDs
CPLDs
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Dernier (20)

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

Strings in Java

  • 1. TEST (MODULE:- 1 and 2)  What are command line arguments? Write a program in JAVA to print Fibonacci series using command line arguments? [10]  Create a class employee with data members empid, empname, designation and salary. Write methods for:- [10] get_employee()- To take user input. show_grade()- To display grade of employee based on salary. show_employee()- To show employee details.  Write a note on:- [10]  Java Virtual Machine.  Nesting of Methods with example
  • 2. STRINGS IN JAVA - Ankita Karia
  • 3. STRINGS  Strings represent a sequence of characters.  The easiest way to represent a sequence of characters in JAVA is by using a character array. char Array[ ] = new char [5]; Character arrays are not good enough to support the range of operations we want to perform on strings. In JAVA strings are class objects and implemented using two classes:- String StringBuffer. In JAVA strings are not a character array and is not NULL terminated.
  • 4. DECLARING & INITIALISING • Normally, objects in Java are created with the new keyword. String name; name = new String("Craig"); OR String name= new String("Craig"); • However, String objects can be created "implicitly": String name; name = "Craig";
  • 5. The String Class String objects are handled specially by the compiler. String is the only class which has "implicit" instantiation. The String class is defined in the java.lang package. Strings are immutable.  The value of a String object can never be changed. For mutable Strings, use the StringBuffer class.
  • 6. DYNAMIC INITIALIZATION OF STRINGS BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String city = br.readLine(); Give throws IOException beside function name Scanner sc=new Scanner(System.in); String state=sc.nextLine(); String state1=sc.next();
  • 7. STRING CONCATENATION  JAVA string can be concatenated using + operator. String name="Ankita"; String surname="Karia"; System.out.println(name+" "+surname); STRING Arrays •An array of strings can also be created String cities [ ] = new String[5]; • Will create an array of CITIES of size 5 to hold string constants
  • 8. String Methods  The String class contains many useful methods for string- processing applications. ◦ A String method is called by writing a String object, a dot, the name of the method, and a pair of parentheses to enclose any arguments ◦ If a String method returns a value, then it can be placed anywhere that a value of its type can be used String greeting = "Hello"; String method int count = greeting.length(); System.out.println("Length is " + greeting.length()); ◦ Always count from zero when referring to the position or index of a character in a string
  • 10. Some Methods in the Class String (Part 1 of 8) 1-10
  • 11. Some Methods in the Class String (Part 2 of 8)
  • 12. Some Methods in the Class String (Part 3 of 8)
  • 13. Some Methods in the Class String (Part 4 o 8)
  • 14. Some Methods in the Class String (Part 5 o 8)
  • 15. Some Methods in the Class String (Part 6 of 8)
  • 16. Some Methods in the Class String (Part 7 o
  • 17.
  • 18. STRING BUFFER  CLASS STRINGBUFFER class creates strings flexible length that can be modified in terms of both length and content.  STRINGBUFFER may have characters and substrings inserted in the middle or appended to the end.  STRINGBUFFER automatically grows to make room for such additions Actually STRINGBUFFER has more characters pre allocated than are actually needed, to allow room for growth
  • 19. STRING BUFFER CONSTRUCTORS  String Buffer():- Reserves room fro 16 characters without reallocation  StringBuffer(int size):- Accepts an integer argunent that explicilty sets the size of the buffer  StringBuffer(String str):- Accepts STRING argument that sets the initial contents of the STRINGBUFFER and allocated room for 16 additional characters.
  • 20. STRING BUFFER FUNCTIONS  length():-Returns the current length of the string.  capacity():- Returns the total allocated capacity.  void ensureCapacity():- Preallocates room for a certain number of characters.  void setLength(int len):- Sets the length of the string s1 to len. If len<s1.length(), s1 is truncated. If len>s1.length(), zeros are added to s1.  charAt(int where):- Extracts value of a single character.  setCharAt(int where, char ch):- Sets the value of character at specified position.
  • 21.
  • 22. STRING BUFFER FUNCTIONS  append(s2):- Appends string s2 to s1 at the end.  insert(n,s2 ):- Inserts the string s2 at the position n of the string s1  reverse():- Returns the reversed object on when it is called.  delete(int n1,int n2):- Deletes a sequence of characters from the invoking object. n1 Specifies index of first character to remove Specifies index one past the lastcharacter to n2 remove  deleteCharAt(int loc):- Deletes the character at the index specified by loc.
  • 23. STRING BUFFER FUNCTIONS  replace(int n1,int n2,String s1):- Replaces one set of characters with another set.  substring(int startIndex):- Returns the substring that starts at starts at startIndex and runs to the end.  substring(int startIndex, int endIndex):- Returns the substring that starts at starts at startIndex and runs to the endIndex-1 VECTOR