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

Read the excerpt from "Death by Black Hole. " If you were made of rubber then you would just stretch in response. But humans are composed of other materials suc
could I know if they are rational numbers or irrational numbers? if they are rational just say "r" and if irrational say "i" !!!​
The y axis is a line of symmetry for a triangle. The coordinates of two of its vertices are (-3, 2) and (0,5)A. What are the coordinates of the third vertex?B.
17 protons and 18 neutrons what is the mass number and atomic number
Apart from plants, what other group of organisms photosynthesises?​
Help, how do I do number 16??
What is the measure of ∠BFC?
What is the value of x ?
pls help with odd problems only pls ​
8. Feng shines a thin beam of light onto a prism. The light contains wavelengths of red, blue, green, and yellow light. The diagram below shows how the four col