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

    Default Confusion in line

    Hi,

    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
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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, 04:02 PM
  2. Tic Tac Toe confusion
    By jigglywiggly in forum New To Java
    Replies: 15
    Last Post: 04-12-2009, 02:47 AM
  3. Replies: 9
    Last Post: 04-07-2009, 04:51 AM
  4. Confusion over arrays
    By dbashby in forum New To Java
    Replies: 5
    Last Post: 04-04-2009, 10: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
  •