francescahili francescahili
  • 19-06-2020
  • Computers and Technology
contestada

declare and initialise a variable called 'initial' that will hold the first letter of your name in java

Respuesta :

rainestormee
rainestormee rainestormee
  • 19-06-2020

Answer:

Character initial = 'R';

Explanation:

For defining a variable, first you must identify the type of the variable, in this case it is a Character as we are only holding a single character.

The next step in defining a variable is the identifier, which is the name of the variable, in this case "initial".

Now we need to assign the needed character, in this case 'R' (for my first name), you use a single '=' to assign a variables, and finally you close the line with a semi-colon, as is standard in Java.

Answer Link

Otras preguntas

How do I factor the polynomial: 6xy^2-3xy+8y-4?
Andrea drew the number line below she said that 9/8 and 1 or equal explain her hair
Show how to make a ten to solve 13-7. Write the number sentence.
A Muslim girl who is kept at home while her brothers go to school, and who is taught by her mother to keep her hair covered by a scarf or other form of wrapped
What was Robert Hooke's contribution to biology?
justify why each of the following attitudes and behaviour will be ineffective when dealing with interpersonal conflict 1.3.1 Avoiding conflict 1.3.2 Competing w
Which graph represents selection that may lead to reduced variation in a population?
Autumn chants my visions to sleep in line 8 is an example of which literary device? a. metaphor c. simile b. personification d. alliteration
20 gallons to tenth of a liter
Satelit sering disebut