Declarations and Access Control Logic

© examsiri.com
Question : 14 of 29
 
Marks: +1, -0
Given:
1. public enum Title {
2.   MR("Mr."), MRS("Mrs."), MS("Ms.");
3.   private final String title;
4.   private Title(String t) { title = t; }
5.   public String format(String last, String first) {
6.    return title + " " + first + " " + last;
7.   }
8. }
9. public static void main(String[] args) {
10.   System.out.println(Title.MR.format("Doe", "John"));
11. }

what is the result?
Go to Question: