SlideShare una empresa de Scribd logo
1 de 19
String Handling Supported by :  java.lang.String java.lang.StringBuffer java.lang.StringBuilder
String ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],s2=s1.concat(s2); Java J2ee Heap s1 s2 Java J2ee Heap s1 s2 JavaJ2ee
[object Object],[object Object]
String Literal & String Constant Pool ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],s1 String Constant Pool microsoft IBM s2 s3 Heap s4 microsoft s5
String Literal & String Constant Pool   ,[object Object]
[object Object]
[object Object]
Understanding the different ways to create String Objects ,[object Object],Noida s1 String Pool ,[object Object],[object Object],Heap Delhi s3 s2 Delhi Noida ,[object Object]
+ & += have been overloaded to work on Strings. ,[object Object],[object Object],[object Object],[object Object],6 a a c String Pool is whole no. Heap s1 s2 whole no. 6 is a whole no. System.out.println(a+s1+c+s2);
Working with Strings : Using public methods defined in the java.lang.String ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shallow & Deep Comparison ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],java.lang.Object java.lang.String Output :  true true false true public boolean equals(java.lang.Object); public boolean equals(java.lang.Object); equals (java.lang.Object) of java.lang.Object is overridden by equals(java.lang.Object) of java.lang.String
Shallow & Deep Comparison  contd. ,[object Object],[object Object],String Pool Heap s1 s3 s2 star star
StringBuffer ,[object Object],[object Object],String s = “keyboard”; s.concat(“mouse”); System.out.println(s);  // output ? String s = “Tom” s=s.concat(“cat”); System.out.println(s);  // output ?
StringBuffer  contd. ,[object Object],[object Object],[object Object],[object Object]
Important methods of StringBuffer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],StringBuffer sb = new StringBuffer(); sb.append(“5>6=“); sb.append(5>6);
Important methods of StringBuffer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
StringBuffer  contd. ,[object Object],[object Object],[object Object],[object Object],Output : false false java.lang.Object java.lang.StringBuffer java.lang.AbstractStringBuilder public boolean equals(java.lang.Object);

Más contenido relacionado

La actualidad más candente

String and string buffer
String and string bufferString and string buffer
String and string buffer
kamal kotecha
 

La actualidad más candente (20)

Java string handling
Java string handlingJava string handling
Java string handling
 
Strings in Java
Strings in JavaStrings in Java
Strings in Java
 
Collections in Java Notes
Collections in Java NotesCollections in Java Notes
Collections in Java Notes
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Java Collections
Java  Collections Java  Collections
Java Collections
 
Java collection
Java collectionJava collection
Java collection
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
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 collections concept
Java collections conceptJava collections concept
Java collections concept
 
Python set
Python setPython set
Python set
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
Interface in java
Interface in javaInterface in java
Interface in java
 
Java Collection framework
Java Collection frameworkJava Collection framework
Java Collection framework
 
Java multi threading
Java multi threadingJava multi threading
Java multi threading
 
Generics in java
Generics in javaGenerics in java
Generics in java
 
Presentation1
Presentation1Presentation1
Presentation1
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
How Hashmap works internally in java
How Hashmap works internally  in javaHow Hashmap works internally  in java
How Hashmap works internally in java
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 

Destacado

Indian Property Lawyers .com - How It Works
Indian Property Lawyers .com - How It WorksIndian Property Lawyers .com - How It Works
Indian Property Lawyers .com - How It Works
buzzfactory
 
Strinng Classes in c++
Strinng Classes in c++Strinng Classes in c++
Strinng Classes in c++
Vikash Dhal
 
String handling(string buffer class)
String handling(string buffer class)String handling(string buffer class)
String handling(string buffer class)
Ravi_Kant_Sahu
 
String Handling in c++
String Handling in c++String Handling in c++
String Handling in c++
Fahim Adil
 

Destacado (19)

Java strings
Java   stringsJava   strings
Java strings
 
Exceptional Handling in Java
Exceptional Handling in JavaExceptional Handling in Java
Exceptional Handling in Java
 
Exception handling
Exception handlingException handling
Exception handling
 
Indian Property Lawyers .com - How It Works
Indian Property Lawyers .com - How It WorksIndian Property Lawyers .com - How It Works
Indian Property Lawyers .com - How It Works
 
StringTokenizer in java
StringTokenizer in javaStringTokenizer in java
StringTokenizer in java
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
 
New presentation1
New presentation1New presentation1
New presentation1
 
Case studies
Case studiesCase studies
Case studies
 
String c++
String c++String c++
String c++
 
Strings v.1.1
Strings v.1.1Strings v.1.1
Strings v.1.1
 
L13 string handling(string class)
L13 string handling(string class)L13 string handling(string class)
L13 string handling(string class)
 
Final keyword in java
Final keyword in javaFinal keyword in java
Final keyword in java
 
exception handling
exception handlingexception handling
exception handling
 
April 2014
April 2014April 2014
April 2014
 
Strinng Classes in c++
Strinng Classes in c++Strinng Classes in c++
Strinng Classes in c++
 
Strings
StringsStrings
Strings
 
String handling(string buffer class)
String handling(string buffer class)String handling(string buffer class)
String handling(string buffer class)
 
String Handling in c++
String Handling in c++String Handling in c++
String Handling in c++
 

Similar a String Handling

javastringexample problems using string class
javastringexample problems using string classjavastringexample problems using string class
javastringexample problems using string class
fedcoordinator
 

Similar a String Handling (20)

Day_5.1.pptx
Day_5.1.pptxDay_5.1.pptx
Day_5.1.pptx
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Java String Handling
Java String HandlingJava String Handling
Java String Handling
 
Text processing
Text processingText processing
Text processing
 
Module-1 Strings Handling.ppt.pdf
Module-1 Strings Handling.ppt.pdfModule-1 Strings Handling.ppt.pdf
Module-1 Strings Handling.ppt.pdf
 
Java - Strings Concepts
Java - Strings ConceptsJava - Strings Concepts
Java - Strings Concepts
 
Java Presentation on the topic of string
Java Presentation  on the topic of stringJava Presentation  on the topic of string
Java Presentation on the topic of string
 
13 Strings and text processing
13 Strings and text processing13 Strings and text processing
13 Strings and text processing
 
LectureNotes-04-DSA
LectureNotes-04-DSALectureNotes-04-DSA
LectureNotes-04-DSA
 
javastringexample problems using string class
javastringexample problems using string classjavastringexample problems using string class
javastringexample problems using string class
 
07slide
07slide07slide
07slide
 
8. String
8. String8. String
8. String
 
Autoboxing and unboxing
Autoboxing and unboxingAutoboxing and unboxing
Autoboxing and unboxing
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Strings in java
Strings in javaStrings in java
Strings in java
 
Java: Objects and Object References
Java: Objects and Object ReferencesJava: Objects and Object References
Java: Objects and Object References
 
JAVA CONCEPTS
JAVA CONCEPTS JAVA CONCEPTS
JAVA CONCEPTS
 
String handling
String handlingString handling
String handling
 
package
packagepackage
package
 
Arrays string handling java packages
Arrays string handling java packagesArrays string handling java packages
Arrays string handling java packages
 

Más de Bharat17485

Channel Based Io
Channel Based IoChannel Based Io
Channel Based Io
Bharat17485
 
Developing Multithreaded Applications
Developing Multithreaded ApplicationsDeveloping Multithreaded Applications
Developing Multithreaded Applications
Bharat17485
 
Interfaces & Abstract Classes
Interfaces & Abstract ClassesInterfaces & Abstract Classes
Interfaces & Abstract Classes
Bharat17485
 
Exceptions & Its Handling
Exceptions & Its HandlingExceptions & Its Handling
Exceptions & Its Handling
Bharat17485
 
Primitive Wrappers
Primitive WrappersPrimitive Wrappers
Primitive Wrappers
Bharat17485
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
Bharat17485
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input Output
Bharat17485
 
Applying Generics
Applying GenericsApplying Generics
Applying Generics
Bharat17485
 

Más de Bharat17485 (12)

Channel Based Io
Channel Based IoChannel Based Io
Channel Based Io
 
Core Java
Core JavaCore Java
Core Java
 
Developing Multithreaded Applications
Developing Multithreaded ApplicationsDeveloping Multithreaded Applications
Developing Multithreaded Applications
 
Interfaces & Abstract Classes
Interfaces & Abstract ClassesInterfaces & Abstract Classes
Interfaces & Abstract Classes
 
Enum
EnumEnum
Enum
 
Exceptions & Its Handling
Exceptions & Its HandlingExceptions & Its Handling
Exceptions & Its Handling
 
Jstl & El
Jstl & ElJstl & El
Jstl & El
 
Primitive Wrappers
Primitive WrappersPrimitive Wrappers
Primitive Wrappers
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input Output
 
Swing
SwingSwing
Swing
 
Applying Generics
Applying GenericsApplying Generics
Applying Generics
 

Último

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

String Handling

  • 1. String Handling Supported by : java.lang.String java.lang.StringBuffer java.lang.StringBuilder
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.