This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int numberOfEmailsInInbox = 0; | |
int numberOfDraftEmails = 2; | |
String emailMessage = "You have " + numberOfEmailsInInbox + " emails. "; | |
String draftMessage = "You have " + numberOfDraftEmails + " email drafts."; | |
if (numberOfEmailsInInbox == 0) { | |
emailMessage = "You have no new messages. "; | |
} | |
if (numberOfDraftEmails == 0) { | |
draftMessage = "You have no new drafts."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isRaining = false; | |
Log.v("WeatherActivity", "Thank you for using the WhetherWeather App."); | |
if (isRaining) { | |
Log.v("WeatherActivity", "It's raining, better bring an umbrella."); | |
} else { | |
Log.v("WeatherActivity", "It's unlikely to rain."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculates the price of the order. | |
* | |
* @param quantity is the number of cups of coffee ordered | |
*/ | |
private void calculatePrice(int quantity) { | |
int price = quantity * 5; | |
} |