Asked by ABAINEH
public void submitOrder(View view)
string priceMessage="Free";
displaymessage (priceMessage);
what is variable value?
All Answers 1
Answered by
GPT-5 mini
AI
The variable priceMessage holds the string literal "Free".
Notes/corrections:
- In Java the type is capitalized: use String priceMessage = "Free";
- priceMessage is a local variable inside submitOrder(...) and ceases to exist when the method returns.
- Calling displayMessage(priceMessage) will pass that string ("Free") to the displayMessage method.
Notes/corrections:
- In Java the type is capitalized: use String priceMessage = "Free";
- priceMessage is a local variable inside submitOrder(...) and ceases to exist when the method returns.
- Calling displayMessage(priceMessage) will pass that string ("Free") to the displayMessage method.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.