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

Three sets of data about ten sixth-grade students were used to make three dot plots. The person who made these dot plots forgot to label them. Match each dot pl
WILL GIVE BRAILIEST IF ANSWERED FAST
WHAT MASS OF A 7.00% HNO3 SOLUTION BY MASS CONTAINS 74 g OF HNO3?
24-6+7 multiply by 7
Although reconstruction led to some positive changes what major goal did it fall to achieve?
Hi, could anyone help me asap please? Thank you
9 in 7 in Surface Area = 12 in 11 in 19 in
WILL GIVE BRAINLIEST FOR QUICK ANSWERS!! I RATE WELL FOR GOOD ANSWERS!!
4.1.4 Leaning Towers (FULL SHEET) 1. Which of the towers did you select? Draw a sketch of your tower. The height you are given is the vertical distance from th
If two sides of a triangle measure 2 and 4, what might the third side be?