Results 1 to 2 of 2
  1. #1
    JavaJunkie is offline Member
    Join Date
    Apr 2009
    Rep Power

    Default Confusion in line


    I've little confusion in the line of page no. 552 of HeadFirst Java, that says:

    The other option (if it's possible) would be to subclass the element and make the subclass implement Comparable.

    What does "subclass the element" mean in above line?

    Thanks in advance.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power


    Create a child class from the element's class. Say the original class is called Element, then create something like so:
    Java Code:
    public class Child extends Element implements Comparable<Child> {
    Note that I do not have this book, so a better answer may require more context.

Similar Threads

  1. confusion in paragraph
    By JavaJunkie in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 05-19-2009, 03:02 PM
  2. Tic Tac Toe confusion
    By jigglywiggly in forum New To Java
    Replies: 15
    Last Post: 04-12-2009, 01:47 AM
  3. Replies: 9
    Last Post: 04-07-2009, 03:51 AM
  4. Confusion over arrays
    By dbashby in forum New To Java
    Replies: 5
    Last Post: 04-04-2009, 09:38 PM
  5. bracket confusion...?
    By gallimaufry in forum New To Java
    Replies: 4
    Last Post: 10-28-2008, 12:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts