Monday, October 18, 2021

If Statements In Java

If statements are at the core of any Java program. They allow you to make decisions in your code.

public class Cake {  final static boolean I_HATE_CAKE = false;	  public static void main(String[] args) {    // TODO Auto-generated method stub    if (I_HATE_CAKE) {      System.out.println("I really don't like cake. I hate it.");    } else {      System.out.println("I enjoy cake.");    }  }}

No comments:

Post a Comment

No Sleep

 This is the second day I've woken up early. Like way earlier than normal. Like four am early. I don't know what to do about it. I n...