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

How are the areas of a triangle and a parallelogram with the same base and height related?
-3/2 multiplied by 3?
A stock split A. causes a decrease in the number of shares outstanding. B. increases the par or stated value in proportion. C. reduces retained earnings. D. Non
Choose the sentence which contains an indirect object. a. They gave me a bonus. b. I worked hard each day. c. I spent it immediately. d. It is difficult to
Echoic memory and iconic memory are a part of the __________ memory. a. sensory b. long-term c. context d. short-term
what happen to the frequency of a sound wave as you change the pitch? what changes with more value?
The dark reaction of photosynthesis is also called the
Pierre is running 26 and 2/10 miles in the marathon. He has run 3/4 of the way. How far has he run?
which of the following describes the purpose of the Monroe doctrine
Roundworms have _____ muscle that helps them move. striated circular longitudinal retractor