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

I don’t understand” please help!! It’s due tomorrow
Instructions Conjuguez les verbes entre parenthèses ou laissez-les à l'infinitif. MATTHIEU Tu as raison. Ce sera très agréable. Il faut __________ (aller) LISE
What happens in a Bronsted-Lowry acid-base reaction?
Are these questions biased or not???​
being The first country to land on the moon became so important to Americans that President Kennedy will promise to put a man on the Moon by the end of the 1960
Need help in this problems
What is p(t)=-log_10(t)^.5 in exponential form
Anyone have the answer???????????
how would the expression x^3-8 be rewritten using difference of cubes ​
Help me with this math question!