Skip to content

Commit 461df1a

Browse files
committed
Added Simle If explation and Progran
1 parent a4923c2 commit 461df1a

File tree

3 files changed

+173
-14
lines changed

3 files changed

+173
-14
lines changed

.idea/workspace.xml

Lines changed: 130 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
### Java If-else Statement
2+
3+
---------
4+
5+
The Java if statement is used to test the condition. It checks boolean condition: true or false. There are various types of if statement in java.
6+
7+
if statement
8+
if-else statement
9+
if-else-if ladder
10+
nested if statement
11+
12+
13+
-------
14+
15+
##### Java if Statement
16+
17+
The Java if statement tests the condition. It executes the if block if condition is true.
18+
19+
```java
20+
if(condition){
21+
//code to be executed
22+
}
23+
```
24+
25+
![SimpleIf](https://static.javatpoint.com/images/core/if1.png)
26+
27+
------
28+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package Control_Statement.SimpleIf;
2+
3+
public class SimpleIf_Age {
4+
public static void main(String[] args) {
5+
//defining an 'age' variable
6+
int age=20;
7+
//checking the age
8+
if(age>18){
9+
System.out.print("Age is greater than 18");
10+
}
11+
}
12+
}
13+
14+
//Age is greater than 18
15+

0 commit comments

Comments
 (0)