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
laila [671]
3 years ago
8

Write a method that returns a String that is just the first and last character of the given string Your return value should be o

nly two characters long. You can assume that the given string will not be empty.​
Computers and Technology
1 answer:
QveST [7]3 years ago
7 0

Answer:

The method in Java is as follows:

public static String returnlen(String input){

   String output = ""+input.charAt(0)+input.charAt(input.length()-1);

   return output;

}

Explanation:

This defines the method

public static String returnlen(String input){

This concatenates the first and the last character of the input string

   String output = ""+input.charAt(0)+input.charAt(input.length()-1);

This returns the concatenated string

   return output;

}

You might be interested in
The efficiency for recursively traversing a chain of linked nodes is
Kay [80]

Answer:

D. O(n).

Explanation:

A chain of linked nodes also known as linked list.So the efficiency of recursively traversing the linked list is O(n) because in recursion it has to traverse over the full linked list.Go to every node and then to it's next there are no other paths to reach to the last there is only one path that goes through every node so the time complexity will be O(n).

8 0
3 years ago
Which resource helps a user access a cloud service?
Gala2k [10]
The answer is computer networking.
6 0
3 years ago
Read 2 more answers
It's fill the gap homework
enyata [817]

beaiutuvssu mean lo seco mein es

6 0
4 years ago
Sarah has entered data about football players from team A and team B in a worksheet. She enters names of players from team A wit
deff fn [24]
I believe the answer is freeze pane view

7 0
3 years ago
Read 2 more answers
Because the data was formatted the same in two inventory files, you decided to combine their contents into one file. Now you wan
snow_tiger [21]

Answer:

c. uniq

Explanation:

3 0
3 years ago
Other questions:
  • Which ipsec component is software that handles the tasks of encrypting, authenticating, decrypting, and checking packets?
    10·1 answer
  • The disk drive is a secondary storage device that stores data by _____ encoding it onto a spinning circular disk.
    14·1 answer
  • Give an example of an expression that has three terms. The first term should have two factors, the second term should have three
    14·1 answer
  • Which memory device is most appropriate for backing up a computer’s hard drive?
    11·2 answers
  • PLEASE HELP ASAP!!
    6·2 answers
  • The keys to successful outsourcing are accountability, reporting, and ___
    7·1 answer
  • The most effective technique of malware propagation among the following list
    7·1 answer
  • Schuyler is making a list of the parts of a computer that are software. Which of the following will be on the list?
    13·2 answers
  • Select the correct answer.
    10·1 answer
  • How to fix this? Zoom it in to see it better
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!