Oracle
1Z0-811 · Question #35
1Z0-811 Question #35: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-811 to reveal the answer and full explanation for question #35. The question stem and answer options stay visible for context.
Data Types and Operators
Question
Given:
public class Course {
public static void main (String [] args) {
double courseFee = 1000.0;
float percentage = 5.0f;
// line n1
newFee = courseFee * percentage;
System.out.println (newFee);
}
}
Which statement, when inserted at line n1, enables the Course class to compile?
Options
- Aint newFee;
- Bdouble newFee;
- Clong newFee;
- Dfloat newFee;
Unlock 1Z0-811 to see the answer
You've previewed enough free 1Z0-811 questions. Unlock 1Z0-811 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#Type Promotion#Arithmetic Operations#Type Compatibility#Primitive Types