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
Alex73 [517]
3 years ago
8

Write method reverseString, which takes a string str and returns a new string with the characters in str in reverse order. For e

xample, reverseString("ABCDE") should return "EDCBA".
Complete the reverseString method below by assigning the reversed string to result.

/** Takes a string str and returns a new string

* with the characters reversed.

*/

public static String reverseString(String str)

{

String result = "";

return result;

}
Computers and Technology
1 answer:
son4ous [18]3 years ago
3 0

Answer:

The method written in Java is as follows:

public static String reverseString(String str){

    String result = "";

    int lentt = str.length();

    char[] strArray = str.toCharArray();

       for (int i = lentt - 1; i >= 0; i--)

           result+=strArray[i];

    return result;

}

Explanation:

This defines the method

public static String reverseString(String str){

This initializes the result of the reversed string to an empty string

    String result = "";

This calculates the length of the string

    int lentt = str.length();

This converts the string to a char array

    char[] strArray = str.toCharArray();

This iterates through the char array

       for (int i = lentt - 1; i >= 0; i--)

This gets the reversed string

           result+=strArray[i];

This returns the reversed string            

    return result;

}

<em>See attachment for full program that includes the main method</em>

Download txt
You might be interested in
What are techniques for active listening? Select all
erastova [34]

Answer:

asking clarifying questions, without interruption

6 0
3 years ago
In Asch’s study which of these lowered conformity rates
skad [1K]

Answer:

D. all of these are correct

Explanation:

option d is correct answer

3 0
3 years ago
Read 2 more answers
Indicate whether the following actions are the actions of a person who will be a victim, or will not be a victim, of phishing at
Zepler [3.9K]

Answer:

Phishing Victim

Explanation:

Replying to this email could make you a victim of a phishing scam. Phishing attacks are common challenges on security that internet users are faced with. It could lead to others getting hold of sensitive information like your password or bank details. email is one way the hackers used to get this information. replying to such an email could lead one to an unsecure website where information could be extracted

4 0
3 years ago
List &amp; briefly explain 5 benefits of having a Business bank account.
oee [108]

Answer:  down there

Explanation:

Some other benefits come from establishing a business bank account. You can gain access to services that make life easier, such as merchant account and payroll services, free online banking and, importantly, easier access to small business loans.

3 0
3 years ago
Read 2 more answers
How will bits and bytes of computer networking help in my career goal?
Allisa [31]

Answer:

By helping you learn and understand the very basics of computer networking therefor giving you a building block to use

Explanation:

ive been asked this before

6 0
2 years ago
Other questions:
  • Legal counsel has notified the information security manager of a legal matter that will require the preservation of electronic r
    8·1 answer
  • Information security is defined as practice of preventing unauthorized access, use, disclosure, disruption, modification, or ___
    6·1 answer
  • Which hexadecimal-type address refers to a physical networking device such as a network interface card?
    10·1 answer
  • Research shows that a passive close to a cover letter leads to more interviews. Please select the best answer from the choices p
    8·2 answers
  • Which of the selection below does not represent a workable IP address?
    9·1 answer
  • Florida law requires every child blank years of age or younger use a crash tested federally be approved child restraint device
    5·2 answers
  • The picture above is a description of the C code below. Please modify the C below so that it uses FILE HANDLING (fopen, fputs, f
    5·1 answer
  • I’m gonna ask this again because I REALLY need an answer.
    10·2 answers
  • And<br>Why the computer is called dilligent<br>Versatile machine?give long answer ​
    10·1 answer
  • Arrange these steps of creating a presentation in the correct order. (notice that the given order is incorrect other than the ba
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!