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]
2 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]2 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
Which type of footwear should be worn while working on a hybrid vehicle?
Dmitrij [34]

Hello there!

Shoes with rubber souls would be the best bet.

7 0
3 years ago
Read 2 more answers
I don't know what to do, anyone there?​
s2008m [1.1K]
I’m here, hello. . . . . . .
3 0
3 years ago
Plz help ( which is an example of a good URL?
Simora [160]

The answer is B because it is short and simple and gets you to the point

8 0
3 years ago
Read 2 more answers
It is common for people to name directories as dir1, dir2, and so on. When there are ten or more directories, the operating syst
Vikki [24]

Answer:

Here the code is given as follows,

Explanation:

7 0
2 years ago
(1)(50%) The program converts a three-ASCII-digit number to an 8-bit unsigned binary. For example, a 3-digit number as ‘0’ (=$30
MatroZZZ [7]

Answer:

Explanation:

3 - digit number                                             8 - bit binary

0 (=$30), 1 (=$31), & 8 (=$38)                          00010010

1 (=$31), 2 (=$32), & 9 (=$39)                          10000001

2 (=$32), 3(=$33), & 0 (=$40)                          11100110

2 (=$32), 4 (=$34), & 1 (=$41)                           11110001

2 (=$32), 5 (=$35), & 2 (=$42)                           11111100

2 (=$32), 5 (=$35), & 3 (=$ 43)                           11111101

2 (=$32), 5 (=$35), & 4 (=$44)                            11111110

2 (=$32), 5 (=$35), & 5 (=$45)                            11111111              

8 0
3 years ago
Other questions:
  • Musccanic Inc., a company that manufactures microprocessors, updates the technology used in its microprocessors once every four
    15·1 answer
  • Why do objects in the back seat move when the car turns
    11·1 answer
  • A four-year old laptop will not boot and presents error messages on screen. You have verified with the laptop technical support
    11·1 answer
  • If you wish to maintain a consistent style to all the documents you create, it would be helpful to use a _____.
    10·1 answer
  • You are requesting information about wireless connectivity for your workplace computers. Because you expect the information to b
    15·1 answer
  • You have created a new dhcp scope with address range 192.168.1.1 to 192.168.1.254. you have five servers configured with static
    9·1 answer
  • Literally no one helps answer my questions so this website is pointless.... : /
    11·1 answer
  • What is Stefen Salvators mom name? For the tvd fans
    12·2 answers
  • ________ can be written only once. The data cannot be erased or written over once it is saved.​
    9·1 answer
  • The BCD number for decimal 473 is( ). a) 111011010; b) 010011110011; c) 010001110011; d)0010110110​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!