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

2n - 5 = 31 Answer: The value of n is ....
Which political group believed that states' rights weren't nearly as important as national power?
The angle measurements in the diagram are represented by the following expressions.
Help ASAP Will give Brainllest . Please explain how you got the answer
What is ironic about the description of who holds the events? So b oladime and energy to devote to vie headb a nd people are sorry for him, because It is ironic
joe worked in the coal mines until it closed. he cannot find another job.
Since she didn’t eat her dinner, her parents wouldn’t let her have chocolate cake for dessert. A. since B. didn't C. wouldn't D. for
A point is translated 2 units right and 5 units down on the coordinate plane. How will this affect the x- and y-coordinates of the point? NEED THIS ANSWERED BY
What is the area of the triangle?
What year did Great Britain first arrive in India to set up trading posts?