fundamental Code Samples
- What's needed to be prepared for learning Java programming?
- Hello World example in Java
- Java Programming Keywords Summary
- How do I get the command line arguments passed to the program?
- How do I use Override annotation?
- How do I do bitwise exclusive OR operation?
- How do I create an inner class?
- How do I mark method as deprecated?
- How do I clone an object?
- How do I compare string regardless their case?
- What is SuppressWarnings annotation?
- How do I create type specific collections?
- How do I define constructor in enum type?
- How do I use enum in switch statement?
Page 1 of 6 |
Prev
|
Next
How do I use the if-then statement?
The if-then is the most basic control flow statement. It will execute the block of statement only if the test expression evaluated equals to true. Let's see the example below:
The result of the above program is:
A(10) is bigger than B(5) B(5) is smaller that A(10)