Ask Question
12 May, 15:11

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

+5
Answers (1)
  1. 12 May, 18:29
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers