Site Search:

OCPJP Simulation Test 3

<Back to OCPJP





Question: Given the following contents in Message.java file. What file will be generated with javac Message.java?


  1 public abstract class Message {
  2   String recipient;
  3   void sendMessage(){};
  4   public static void main(String args[]) {
  5     Message email = new XyzMessage();
  6     email.recipient = "John@xyznetwork.com";
  7     email.sendMessage();
  8   }
  9   static class XyzMessage extends Message {
 10     public final void sendMessage()  {
 11       System.out.println("Message is sent to " + recipient);
 12     }}}


Choice:
A. XyzMessage.class
B. Message.bin
C. Message$XyzMessage.class
D. Message
E. Message.class
F. Message$XyzMessage.java
G. Message&XyzMessage.class
H. The code does not compile