What happens when the following program is compiled and run?
public class Employee {
// Primitive data types
double salary;
int age;
boolean isPaid;
char gender = 'm'; // m = male, f = female
public static void main(String[] args){
Employee emp = new Employee();
System.out.print(" " + emp.salary + ",");
System.out.print(" " + emp.age + ",");
System.out.print(" " + emp.isPaid + ",");
System.out.print(" " + emp.gender);
}
}
Selecione uma das seguintes:
-
This code writes ", , , m" to the standard output.
-
This code writes "1.0, 1, true, m" to the standard output.
-
This code writes "0.0, 0, false, m" to the standard output.
-
This code does not compile, because some of the variables are not initialized.