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

A Placebo?

 At times I wonder if my medication is just a placebo. That is a medication that usually has no effect on a disease. Am I dreaming it all up...