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
This semester we looked at three languages (C++, Java and Python). One common rule in all three class checklists (for C++, Java
Marysya12 [62]

Answer:

The languages C++, Java, Python are Object Oriented Programming languages. What this means is that we create classes and then instantiate those classes. In C++ and Java, we use the new operator to instantiate the classes. So, if we want to display some data when we try to print the instance just like we print the variables of data types like int, double, string etc, we need to define what we need to display. It is because, class are just like data types like int, double etc. But as they are defined by the developer according to his/her needs, so the developer has to define what to print when they are printed.

5 0
3 years ago
A program that is used to view websites is called a​
Nookie1986 [14]

Answer:

A web browser

examples of this would be

Bing

6 0
3 years ago
Read 2 more answers
Which is true about routers and switches?
Julli [10]

Answer:

Routers control traffic between networks while switches control traffic within a network

Explanation:

There are different devices involves in computer networking. These devices include hub, switch, router and other components.

Switch is used to connect the computer with in the network. It controls the traffic between different computers within the network. Different computers are connected with each other through different cables with the help of switch.

On the other hand, different LAN's connected through the cable with a router to communicate with each other. This device is used to control the traffic between different networks.

 

8 0
3 years ago
What is CPU<br>and it's functions<br>​
BartSMP [9]

Answer:

CPU is considered as the brain of the computer. CPU performs all types of data processing operations. It stores data, intermediate results, and instructions (program). It controls the operation of all parts of the computer

5 0
3 years ago
Read 2 more answers
If a user has one column in a table and would like to make it into two columns, which command should be used?
8090 [49]

Answer:

Split Cells

Explanation:

7 0
3 years ago
Other questions:
  • If you're able to understand directions more easily when you hear them instead of reading them you are most likely
    12·1 answer
  • To create a unique name for a document before saving to a folder, select _____ on the Office Button menu. a. Save As b. Folder c
    13·2 answers
  • Each array in Java has a public field named ________ that contains the number of elements in the array.
    13·1 answer
  • 45, 78, 23, 12, 63, 90, 38, 56, 88, 15 Using the sequential search as described in this chapter, how many comparisons are requir
    10·1 answer
  • What is the complete predicate in the sentence below? Looking up from his computer monitor, Jason mopped his brow, exhaled sharp
    12·1 answer
  • Write a C program to perform simple C arithmetic calculations. The user is to enter a simple expression (integer operator intege
    9·1 answer
  • Select the correct answer from each drop-down menu.
    8·2 answers
  • Use the table and the drop-down menus to order the
    15·2 answers
  • Why is it important to prevent financial loss
    7·1 answer
  • What is a cell? how is it referred?​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!