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

What is 7% tax on a $9.79 purchase
I Am A Number That Is Double The Product Of 2 And 7. One Of My Factors Is 7 What Is My Other factor
I Am A Number That Is Double The Product Of 2 And 7. One Of My Factors Is 7 What Is My Other factor
How many quarts are in 2 and 3/4 of a gallon
answer the following math question: which place value changed in 6652+600+1000=
What is 7% tax on a $9.79 purchase
Which of the following prefixes is best for measuring large quantities like the mass of a person? milli kilo deci deca
How many quarts are in 2 and 3/4 of a gallon
Which statement is always true about a trapezoid?1.it has 2 congruent sides.2. It has 2 right angles3. It has no congruent angles4. It has exactly 2 parallel si
facts about the Virginia plan