(age>=18) is the condition if the expression is true value “Allowed”is assigned to voting else “Not Allowed” will be assigned to voting. Using Ternary Operator make this program. Programming Beginner To Advanced import java.util.*;class voting{ public static void main(String args[]) { String x; int n; Scanner sc= new Scanner(System.in); System.out.println("Enter the age"); n=sc.nextInt(); x=(n>=18)?"ALLOWED" :"NOT ALLOWED"; System.out.println(x); }} Share This: Facebook Twitter Google+ Stumble Digg