Programming
Python
R
Java
C
C++
C#
WEB
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
MORE
Examples1
Python
GO
R
Java
C
C++
C#
Examples2
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Seo Tools
Code Minifier
Code Beautifier
Language Compiler
Misc Tools
File Converter
References
C
C++
Python
Java
PHP
JavaScript
Examples
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Home
About
Contact
JetPack
Multi Themes-->>
Code it ALL
Scroll TOP
If in Java - CodeGK
Δ Java Examples
Comments
Single-Line Comments in Java
Multi-Line Comments in Java
For_loop
Condition Looping in Java
Array Looping in Java
Break in Java
Continue in Java
While_loop
Java While Loop
Class
Class in Java
Object in Java
Data_types
Bytes in Java
Short in Java
Int in Java
Long in Java
Float in Java
Double in Java
Boolean in Java
Char in Java
If_else
If in Java
Else in Java
Else-If in Java
♦ If in Java
♣ Example1: If in Java
"if" code block is executed when the corresponding if condition block is holding boolean value true.
In this example, .
Example
Input:
Run CODE
Reload Code
Copy Code
public class MyClass { public static void main(String[] args) { int a=1728; int b=112; if (a > b) { System.out.print(a ); System.out.print(" is greater than "); System.out.print(b); } } }
Output:
If_else
If in Java