Java if Statements (JNNC Technologies)


If statements in Java is used to control the program flow based on some condition, it’s used to execute some statement code block if expression is evaluated to true, otherwise it will get skipped. This is an simplest way to modify the control flow of the program.
The basic format of if statement is:
Syntax:
if(test_expression)
{
    statement 1;
    statement 2;
    ...
}

‘Statement n’ can be a statement or a set of statements and if the test expression is evaluated to true, the statement block will get executed or it will get skipped.

0 Comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();