Online Java Compiler By
JavaTpoint.com
import java.lang.Double; import java.util.Scanner; public class DoubleCompareMethodExample3 { public static void main(String[] args) { Double d1 = new Double("24000"); Scanner scanner= new Scanner(System.in); System.out.println("Enter your Family income"); Double d2 = scanner.nextDouble (); int compare = Double.compare(d1,d2); if(compare >= 0){ System.out.println(" You are eligible for the subsidy ."); } else{ System.out.println("Sorry, You are not eligible for the subsidy."); } }}
Output