Oracle
1Z0-809 · Question #105
1Z0-809 Question #105: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #105. The question stem and answer options stay visible for context.
Question
Given:
public class Customer {
private String fName;
private String lName;
private static int count;
public Customer (String first, String last) {fName = first; lName = last; count++;}
public static int getCount() {return count;}
}
public class App {
public static void main (String [] args) {
Customer c1 = new Customer("Larry", "Smith");
Customer c2 = new Customer("Pedro", "Gonzales");
Customer c3 = new Customer("Penny", "Jones");
Customer c4 = new Customer("Lara", "Svenson");
c3 = c2;
c4 = null;
System.out.println (Customer.getCount());
}
}
What is the result?Options
- A0
- B2
- C3
- D4
- E5
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 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.