Ask Question

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

+3
Answers (1)
  1. 7 December, 08:38
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “declare and initialise a variable called 'initial' that will hold the first letter of your name in java ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers