Thread: extend

Results 1 to 9 of 9
  1. #1 extend 
    Dan
    +dan's Avatar
    Join Date
    Nov 2011
    Age
    19
    Posts
    516
    Thanks given
    34
    Thanks received
    32
    Rep Power
    77
    i want to extend a class, but extend has already been used, how else can i use another class?
    importing?
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    What do you mean extend has already been used?
    Reply With Quote  
     

  3. #3  
    Dan
    +dan's Avatar
    Join Date
    Nov 2011
    Age
    19
    Posts
    516
    Thanks given
    34
    Thanks received
    32
    Rep Power
    77
    public class client extends Applet_Sub1
    {
    Reply With Quote  
     

  4. #4  
    Registered Member
    Emily's Avatar
    Join Date
    Jul 2010
    Age
    30
    Posts
    622
    Thanks given
    67
    Thanks received
    215
    Rep Power
    271
    Why would you even think of extending two classes? Think about the logic behind that.

    (super can't have two classes handled for it)

    You can't have two super classes, although you can implement any number of interfaces. I really don't know what your logic behind considering extending more than one class is.

    Short Answer.
    No, you can't extend more than one class. So implement, not extend.

    Edit:

    Could of sworn you mentioned extending more than one class in your post. If not, ignore that portion, pay attention to implementing.
    Reply With Quote  
     

  5. #5  
    Dan
    +dan's Avatar
    Join Date
    Nov 2011
    Age
    19
    Posts
    516
    Thanks given
    34
    Thanks received
    32
    Rep Power
    77
    Quote Originally Posted by Emily View Post
    Why would you even think of extending two classes? Think about the logic behind that.

    (super can't have two classes handled for it)

    You can't have two super classes, although you can implement any number of interfaces. I really don't know what your logic behind considering extending more than one class is.

    Short Answer.
    No, you can't extend more than one class. So implement, not extend.

    Edit:

    Could of sworn you mentioned extending more than one class in your post. If not, ignore that portion, pay attention to implementing.
    i dont care about implementing as i said in my post i am using a class. i already knew you cannot extend more than one class
    Reply With Quote  
     

  6. #6  
    Registered Member
    Emily's Avatar
    Join Date
    Jul 2010
    Age
    30
    Posts
    622
    Thanks given
    67
    Thanks received
    215
    Rep Power
    271
    Quote Originally Posted by +dan View Post
    i dont care about implementing as i said in my post i am using a class. i already knew you cannot extend more than one class
    Then just import your class and create a new instance of it...
    Reply With Quote  
     

  7. #7  
    Dan
    +dan's Avatar
    Join Date
    Nov 2011
    Age
    19
    Posts
    516
    Thanks given
    34
    Thanks received
    32
    Rep Power
    77
    Quote Originally Posted by Emily View Post
    Then just import your class and create a new instance of it...
    import package.class; ?
    Reply With Quote  
     

  8. #8  
    Registered Member
    Emily's Avatar
    Join Date
    Jul 2010
    Age
    30
    Posts
    622
    Thanks given
    67
    Thanks received
    215
    Rep Power
    271
    Quote Originally Posted by +dan View Post
    import package.class; ?
    What?

    Packages are at the top of the files, they are the location that the file is located in a folder.
    Code:
    package org.pokemon.client;
    Imports are the locations to files outside of the folder that you want to use.

    Code:
    import org.pokemon.engine.Engine;
    Reply With Quote  
     

  9. #9  
    Dan
    +dan's Avatar
    Join Date
    Nov 2011
    Age
    19
    Posts
    516
    Thanks given
    34
    Thanks received
    32
    Rep Power
    77
    import package.class;

    as in

    import skills.woodcutting;
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Extend Model Number
    By dren1 in forum Help
    Replies: 0
    Last Post: 11-26-2011, 12:00 PM
  2. [Shard] How to extend ::pickup command
    By zivkovic in forum Help
    Replies: 19
    Last Post: 02-28-2011, 09:41 PM
  3. How would i extend the class 20
    By Organic in forum Help
    Replies: 7
    Last Post: 04-11-2010, 04:10 AM
  4. how to extend texture/graphics list
    By Blazerker in forum Help
    Replies: 0
    Last Post: 12-06-2009, 11:45 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
  •