Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.text.*;
- public class PalindromeTest {
- String inputWord;
- String reversedWord;
- String[] array;
- public PalindromeTest(String word) {
- inputWord = word;
- array = new String[word.length()];
- reversedWord = "";
- }
- public void createBlankReversedWord() {
- for (int i = 0; i < inputWord.length(); i++) {
- reversedWord += " ";
- }
- }
- public void createArray() {
- for (int j = 0; j < inputWord.length(); j++) {
- for (int i = inputWord.length(); i < 0; i--) {
- array[j] = inputWord.substring(i -1, i);
- }
- }
- }
- public void reverseWord() {
- for (int i = 0; i <= array.length; i++) {
- reversedWord.substring(i) = array[i];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement