JAVA-16301: Check Article Code Matches GitHub

This commit is contained in:
freelansam
2022-12-02 18:45:30 +05:30
parent fd85b58fa3
commit aabfbaad08
12 changed files with 149 additions and 13 deletions

View File

@@ -0,0 +1,20 @@
package com.baeldung.s;
public class Book {
private String name;
private String author;
private String text;
//constructor, getters and setters
//methods that directly relate to the book properties
public String replaceWordInText(String word, String replacementWord){
return text.replaceAll(word, replacementWord);
}
public boolean isWordInText(String word){
return text.contains(word);
}
}