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

A somatic cell of the common octopus (Octopus vulgaris) has 56 chromosomes. What number of chromosomes will an octopus gamete contain? A. 14 B. 28 C. 56 D. 112
what is the best estimate for the product of 289 and 7
solve 5c + 4 = -26A. 6B. -6C. -4.4D. 3solve 3x - x + 2 = 12A. -5B. 4C. 7D.5solve 3(x + 1) + 6 = 33A.10B. 8C. 8.7D. -8solve [tex] \frac{y}{-6} [/tex] + = 9A. 24B
Which event in history is seen by many people as the beginning of the Great Depression?
Round 16,326 to the nearest ten
a square photo display board is made up of 60 rows of 60 photos each the area of each square photo is 4 square inches how long is each side of the display board
What is the value of the digit 2 in the number 9,642
A Japanese beetle has length between 0.3 and 0.5 inches.Find two lengths that are within the given span. Write them as fraction in simplest form?PS NO ONE HAS D
What is the answer to 7- 5/3c=22
how do you convert 1.66 into a fraction