1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OLEGan [10]
3 years ago
7

Complete the below method, isPalindrome(), that takes in a String and returns a boolean. The boolean should be true if the Strin

g is a palindrome, i.e., the String is the same if read forwards or in reverse. For example, "racecar" is a palindrome. The method should return false if the String is not a palindrome. Note: any single-letter word is considered a palindrome.
public class StringMethod {
public static boolean isPalindrome(String word) {
//TODO: Complete this method

}
}
Computers and Technology
1 answer:
Salsk061 [2.6K]3 years ago
5 0

Answer:

public static boolean isPalindrome(String word) {

   //TODO: Complete this method

   String reverse = "";  

       for (int i = (word.length()-1); i>=0; i--) {

           if(word.charAt(i)!=' '){

               reverse+=word.charAt(i);

           }

       }

   String without_space = word.replaceAll(" ", "");

   

   return reverse.equals(without_space);

   }

You might be interested in
Which Boolean operator enables you to exclude a search term?
Marysya12 [62]

Boolean Operators are simple words (AND, OR, NOT or AND NOT) used as conjunctions to combine or exclude keywords in a search.

The NOT Boolean operator enables you to exclude a search term. Correct answer: A  The NOR operator excludes words from the search  and by doing that it narrows the search, telling the database to ignore some concepts.

7 0
3 years ago
Read 2 more answers
In a virtual memory system, each process must have its own page table.(True or False?)
Anna71 [15]

Answer: True

Explanation:

 Virtual memory is the secondary storage memory and this type of memory are addressed as main part of the memory.

When the virtual memory copying in the physical memory then, at that time the operating system divide the memory into the file page with the address and definite size number. Then, the each page are store in a disk.

When this page are required then, the operating system copy from disk to main memory and then, the virtual address are converted into the  real address.

6 0
4 years ago
HELP PLEASE! What is an acceptable use policy and what is the purpose of the acceptable use policy?
Ostrovityanka [42]
Hai what is the answer choices?? please tell me so I can help u

3 0
3 years ago
How to reset windows 7 password without logging in
hammer [34]

Explanation:

<em>.</em><em>Reboot your laptop or PC. </em>

<em>Select the Repair your Computer option and press Enter. </em>

<em>The System Recovery Options window will popup, click System Restore, it will check the data in your Restore Partition and factory reset laptop without password.</em>

4 0
3 years ago
Read 2 more answers
The encapsulation unit on the presentation layer of the osi model is
Zielflug [23.3K]
<span>The encapsulation unit on the presentation layer of the OSI model is the Data link layer (2).</span>
7 0
4 years ago
Other questions:
  • You are hired to film a small, independent movie. You have a budget of $200,000 and 10 weeks in which to complete the first roun
    9·1 answer
  • An error condition consisting of an error in the passing of parameters -- a method passes or returns an unexpected value such as
    12·1 answer
  • Write a program that accepts a whole number as
    5·1 answer
  • Moving your Sprite from right to left is considered the X coordinate?
    5·1 answer
  • How can a cell phone tower help people​
    11·2 answers
  • Which of the following bit value represent -5 in two's complement notation?
    5·1 answer
  • Let G = (V, E) be an undirected graph. Design algorithms for the following (in each
    6·1 answer
  • In this assignment, you will implement an online banking system. Users can sign-up with the system, log in to the system, change
    14·1 answer
  • Edra kinsman is the sales manager for narbonne suites hotel chain, which has locations in washington, oregon, idaho, and montana
    14·1 answer
  • In a DTP project, Fiona is looking for a way to make a page layout attractive to readers. Help Fiona pick the correct word to co
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!