1Z0-811 Object-Oriented Programming • Set 2
1Z0-811 Object-Oriented Programming Practice Test 2 — 15 questions with explanations. Free, no signup.
A developer is writing a Java class that models a temperature sensor. The class needs a constructor that accepts an initial temperature and stores it in a private double field named 'value'. The class also needs a method that returns the current temperature. Which code fragment correctly declares the constructor and the accessor method for this class?
Choose an answer to begin — your selection is scored in the full session.
15 questions · instant feedback and full explanations after every question.