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

what is 7298341 rounded to the nearest 10000
what Is 15,609 in expanded form
Convert 2.83 days into seconds
The mass of an electron is approximately 9 × 10^-28 grams, while the mass of a neutron is approximately 2 × 10^-24 grams. Which of the following is true? The m
Which word best completes the sentence? That car runs quite __________ for us. a. good b. well
What is the effect of deforestation
In which of the following sentences is the word its used correctly? A. Its easy to learn to play the guitar, if you're willing to practice. B. The monster reare
Which activity produces the smallest amount of greenhouse gases?
how many times greater is the value of the 7 in 640,700 than the value of the 7 in 67,040
Rings on the scales of some fish show the age of the fish. (1 point)transitive intransitive 2. The electric eel throws a charge of 600 volts. (1 point)transitiv