Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mohanad0/f0fa6ce7f9077ad1a9668bdea9a5d10a to your computer and use it in GitHub Desktop.
Save Mohanad0/f0fa6ce7f9077ad1a9668bdea9a5d10a to your computer and use it in GitHub Desktop.
Android for Beginners : If/Else Email Quiz
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.";
}
Log.v("InboxActivity", emailMessage);
Log.v("InboxActivity", draftMessage);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment