0% found this document useful (0 votes)
6 views16 pages

Java Strings- Advanced Methods & Manipulations

The document outlines a 50-minute session on advanced Java string methods, specifically focusing on Java String Buffer. It includes learning outcomes, activities for student engagement, and hands-on coding exercises to understand string manipulation methods. The session aims to explain the differences between String and String Buffer, along with practical applications of various String Buffer methods.

Uploaded by

anamikamahato102
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views16 pages

Java Strings- Advanced Methods & Manipulations

The document outlines a 50-minute session on advanced Java string methods, specifically focusing on Java String Buffer. It includes learning outcomes, activities for student engagement, and hands-on coding exercises to understand string manipulation methods. The session aims to explain the differences between String and String Buffer, along with practical applications of various String Buffer methods.

Uploaded by

anamikamahato102
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Java Strings: Advanced Methods &

Manipulations

Session No.:
Course Name: OOPS using Java
Course Code: R1UC201C
Instructor Name: Rani Singh
Duration: 50 minutes
Date of Conduction of Class:

Galgotias University 1
Revision
Reflect
• What on the
will be the output of the following?
responses of
1. post session 2

activity

• What is a String in Java?


• How are strings stored in memory in Java?
• Are strings mutable or immutable in Java? Why?

Galgotias University 2
Opening Question
Reflect on the
"Weresponses
know that of String objects in
Java are immutable.
So post
whatsession
if we need to modify astring multiple times
activity
(e.g., appending, inserting, or deleting characters)?
What class can we use to handle such situations
efficiently?"

Galgotias University 3
SESSION OUTLINE

INTRODUCTION TO JAVA STRING BUFFER

ACTIVITY 1
SYNTAX AND EXAMPLES
ACTIVITY 2
CONCLUSION

Galgotias University 4
At the end of this session students will be able to

LEARNING OUTCOME
Explain Java String Buffer and its methods

Galgotias University 5
Java String Buffer
Reflect on the
responses of
post session
activity

Galgotias University 6
Learning Activity 1 : THINK-PAIR SHARE

Think: • Students individually reflect on the difference between String and String
Buffer

Pair: • Students discuss their answers with a partner

Share: • Each Group one member share it with Class.

Galgotias University 7
Learning Activity 1 : Reflection

Galgotias University 8
String Buffer Methods with Example

Galgotias University 9
String Buffer Methods with Example

Galgotias University 10
Learning Activity 1 : Hands-on- coding

Write a program understand the functionality and behavior of key StringBuffer methods
(append(), insert(), replace(), delete(), and reverse()) and compare them with how similar
tasks are handled using the immutable String class.

Galgotias University 11
Learning Activity 1 : Reflection

Galgotias University 12
Lets Conclude The session!!!!!!!!!!

Galgotias University 13
At the end of this session students will be able to

Ensure attainment of LOs in alignment to


the learning activities:
Explain Java String Buffer and its methods

Galgotias University 14
15

Write a Java program that uses split() to


break a sentence into words and print
each word separately.

Post-
Assessmen Modify the string "Java is fun and
powerful" to "Python is fun and
t powerful" using replace().
Questions
Demonstrate the effect of trim() on the
string " Java Programming ".
Open-Ended Questions

Can replace() be used to perform case-


insensitive replacements? How?

16

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy