Skip to content

Commit

Permalink
Finished extension exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
maha897 committed Jan 10, 2024
1 parent c7dd5ba commit f7fed4e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/com/booleanuk/extension/Extension.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Extension {
// The following block of code is a method. You've been using these during the core criteria, and this is how we
// create our own methods. You'll be doing this in a future exercise. For now, write your code between the
// WRITE YOUR CODE BETWEEN THIS LINE...

// ... AND THIS LINE
// See the below example:
public void example() {
Expand All @@ -29,7 +30,7 @@ public StringBuilder one() {
// 1. Using the sb variable above, add "Hello, world!" to the StringBuilder
// WRITE YOUR CODE BETWEEN THIS LINE...


sb.append("Hello, world!");

// ...AND THIS LINE

Expand All @@ -43,7 +44,8 @@ public StringBuilder two() {
// 2. After adding the message, use an appropriate StringBuilder method to reverse it
// WRITE YOUR CODE BETWEEN THIS LINE...


sb.append("Hello, world!");
sb.reverse();

// ...AND THIS LINE

Expand All @@ -57,7 +59,8 @@ public StringBuilder three() {
// 2. After adding the message, remove the comma.
// WRITE YOUR CODE BETWEEN THIS LINE...


sb.append("Hello, world!");
sb.delete(5, 6);

// ...AND THIS LINE

Expand All @@ -71,7 +74,8 @@ public StringBuilder four() {
// 2. After adding the message, replace the word "world" with the word "Java"
// WRITE YOUR CODE BETWEEN THIS LINE...


sb.append("Hello, world!");
sb.replace(7, 12, "Java");

// ...AND THIS LINE

Expand Down

0 comments on commit f7fed4e

Please sign in to comment.