[Unsolved] Class that extends JavaPlugin and another class....

Discussion in 'Plugin Development' started by ASHninja1997, Oct 17, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    ASHninja1997

    I have been try for ever to see if their is a way to extend two things in my main class
    Below is the regular set up for my main class
    Counters is my second class
    Code:java
    1. public class snipecraft extends JavaPlugin implements Listener{

    But i want it to be like this
    Code:java
    1. public class snipecraft extends JavaPlugin && Counters implements Listener{
    2. //the && part was just for demonstration

    But it won't let me do that.......now I have tried some other methods but all of them weren't what I was looking for or they didn't work.
     
  2. Offline

    1Rogue Retired Staff

    Make a new class that extends Counters and then instantiate it as a local variable.
     
  3. Offline

    metalhedd

  4. Offline

    ASHninja1997

    metalhedd 1Rogue
    Thank you guys for your suggestions, as i am packing for a trip i can't test them a.t.m., but I will test them later.
    Thanks :D
     
  5. Offline

    DarkBladee12

    ASHninja1997 Letting a class extend 2 or more classes won't work in Java, but implementing two or more interfaces will work with this "implements A, B, C" ;)
     
  6. Offline

    sgavster

    Code:java
    1. public class snipecraft extends JavaPlugin, Counters implements Listener{
     
  7. Offline

    Tirelessly

    Java does not support multiple inheritance in that manner.
     
Thread Status:
Not open for further replies.

Share This Page