import java.util.*;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter price: $");
float price = keyboard.nextFloat();
System.out.println("Early payment (Y/N): ");
String char1 = keyboard.nextLine();
float amount = price;
if (char1.equals('Y'))
{
amount = price * 0.9;
}
System.out.printf("Amount due: $%0.2f\n", amount);
}
}
when compiling it gives the error of possible lossy conversion, regardless if i pass an int or float.. what is the issue here?