1. package packageA;2. public class Message {3. String getText() { return "text"; }4. }and:1. package packageB;2. public class XMLMessage extends packageA.Message {3. String getText() { return "text";}4. public static void main(String[] args) {5. System.out.println(new XMLMessage().getText());6. }7. }