Question:
What is the result of the following program?
1 public abstract class Email { 2 public String recipient; 3 final void sendEmail(); 4 public static void main(String args[]) { 5 Email email = new XyzEmail(); 6 email.recipient = "John@xyznetwork.com"; 7 email.sendEmail(); 8 } 9 static class XyzEmail extends Email { 10 public final void sendEmail() { 11 System.out.println("Email is sent to " + recipient); 12 }}}
Choice:
A. Email is sent to John@xyznetwork.com
B. Email is sent to null
C. A compiler error occurs on line 3
D. A compiler error occurs on line 9
E. A compiler error occurs on line 11
F. A RuntimeException is thrown
G. None of the above
Next Question