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

Who was the king of England during the colonial years of protest?
Which sentence needs a semicolon added to be correct? A. (5) Water is not everywhere it's miles away. B. (3) If we want to water our yards or wash the dishes, w
Identify the correct sentence . A. Since textbooks are required for this course , students need to buy it . B. A student can write anything that comes to his mi
Which solid figure has six vertices?
how is digestion different in the small and the large intestine?
The federal budget is a record of the nations
what causes changes in density in the asthenosphere
Many villages in the Sahel have been settled ?
sketch nine points.Then,connect the points to form a closed plane figure.What kind of polygon did you draw
What effect does Ezra Pound achieve by excluding the phrase "are like" in favor of a semicolon in this poem, turning the lines into a metaphor instead of a simi