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

The distinction between operating and nonoperating income relates to: (1) continuity of income. (2) primary activities of the reporting entity. (3) consistency
Solve the math problem
20. The sum of two consecutive odd numbers is 72. Find the numbers.
Li2SO4 How many Li atoms are in the formula Li2SO4? 14. How many S atoms are in the formula Li2SO4? 15. How many O atoms are in the formula Li2SO4? 16. How
who said ,"speak slow if you speak love"?​
Quadrilateral ABCD is a parallelogram. If AB=2x-10 and CD=x+30,then AB=_​
When the president signs a bill, it
a stock investment of 160 shares paid a dividend of $584 at this rate what dividend would be paid on 270 shares of stock
Traits controlled by genes on the x-chromosome are said to be.
It was time for Ryan's mom to examine the tamarins, so they headed to the Primate Discovery Center. They walked into the veterinarian's room so that his mother