jilliankaygriff4467 jilliankaygriff4467
  • 04-09-2018
  • Computers and Technology
contestada

Assume that name is a variable of type string that has been assigned a value . write an expression whose value is the first character of the value of name . so if the value of name were "smith" the expression 's value would be 's'.

Respuesta :

hancesoome
hancesoome hancesoome
  • 08-09-2018

For the first question, you would just add the parenthesis to the string mutation1:

String word = "sadly";

String mutation1 = "(" + word + ")";

For the second you need the method substring from the String class:

It is defined as String.substring(begining, ending);

String name = "Smith";

String firstCharacter = name.substring(0, 1);

0 is considered the beginning of the string, then you get the next 1 characters.

Answer Link

Otras preguntas

On a map where each unit represents one kilometer, two marinas are located at P(4,2) and Q(8,12). If a boat travels in a straight line from one marina to the ot
2x+y+4z=16 5x-2y+2z=-1 X+2y-3z=-9
While studying the local raccoon population, a scientist tagged 57 raccoons. Several weeks later, the scientist counted 620 raccoons and saw that 38 of them had
1. Where was the imaginary Line of Demarcation drunn?
EXERCISE 9.1 Answer the following questions ir 1. Write the importance of Census. 2. Why does the population increase at a fast rate 3. What do you understand b
PLEASE HELP WITH THE FOLLOWING
If your name is Ariana Brice pls tell me :)
ebjzugzkcqa quantity which can vary from one individual to another is called a______​
What do you think about the role of technology in teaching language skills?​
Only certain sports rely on a special set of muscles. A. True B. FalseI will report u if you put fake answer