Else-If Statement in Java


Here is the simple program for printing conditional operators in Java.

Source Code

import java.io.*;
import java.util.Scanner;
class ifelse
{
  public static void main(String args[])
  {
    int age=25;
    
    if(age>=18)
    {
      System.out.print("\nYou are Eligible For Voting");
    }
    else
    {
      System.out.print("\nSorry You are not Eligible for Voting");	
    }
  }
}
To download raw file Click Here

Output

The Greatest Number is  : 65


Learn All in Tamil © Designed & Developed By Tutor Joes