Я начинаю пытаться опереться на развитие Android, поэтому я беру андроид для начинающих, я выполнил все инструкции, но получаю сообщение об ошибке «Невозможно разрешить цену символа» в: displayMessage (createOrderSummary (цена));Android Studio Не удается разрешить символ
Это часть кода ...
/**
* This method is called when the order button is clicked.
*/
public void submitOrder(View view) {
int Price = calculatePrice();
displayMessage(createOrderSummary(*price*));
}
/**
* Calculates the price of the order.
*
* @return total price
*/
public int calculatePrice() {
return quantity * 5;
}
/**
*this method will create the order summary.
*@param price of the order
*@return text summary
*/
private String createOrderSummary (int price){
String priceMessage = "Name: Ana";
priceMessage += "\n Price;Quantity:" + quantity;
priceMessage += "\nTotal $"+ price;
priceMessage += "\n Thank You!";
return priceMessage;
}
Это не синтаксическая ошибка для обозначения переменной, начинающейся с буквы верхнего регистра. – Egor
Да, это правда, я отредактирую свой комментарий, чтобы отразить это. –
Спасибо за объяснение! – Mia