Using the printf(), the console prints '?' for number variables. It works fine when I try other variables
public class Main {
public static void main(String[] args) {
boolean myBoolean = false;
char myChar ='$';
String myString = "Hello world";
int myInt= 30;
double myDouble = 123.456;
System.out.printf("boolean = %b\n",myBoolean );
System.out.printf("Char = %c\n",myChar );
System.out.printf("String = %s\n",myString);
System.out.printf("int = %d\n",myInt);
System.out.printf("double = %f\n",myDouble );
}
}
the console prints out this:
boolean = false
Char = $
String = Hello world
int = ??
double = ??????????
I searched the web and couldn't find the exact problem. The closest thing I found was Link
I checked the Enable project specific settings.
I also used the formatf, but the result was the same as printf.