Jump to content
  • 0

[Question] About How Works Inheritance Method.


Question

Posted (edited)


//main class

public class Devs {

 

public static void main (String[]args) {

 

Tryskel dTryskel=new Tryskel ();

Wyatt dWayatt=new Wyatt():

 

}

}

 

//1st class

public class Tryskel {

 

public boolean L2jdeveloper=true;

public boolean Professional=true;

public boolean Clever=true;

public boolean Kind=true;

public boolean Cool=true;

 

}

//2nd class

 

public class Wyatt {

 

public boolean L2jdeveloper=true;

public boolean Professional=true;

public boolean Creative=true;

public boolean Strict=true;

public boolean Tall=false; //making joke

 

 

 

 

 

 

 

}

 

//3rd class

 

public class Me extends Wyatt {

 

 

 

// SO everything i wrote here and declaration of Wyatt will be applied to me ?

 

//am i right?

 

 

 

 

 

}

 

 

 

 

Edited by andon19

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

You can reuse any boolean of Wyatt in Me. Adding your own variables in Me are only shared amongst classes extending Me, or Me itself.

 

On a L2J base :

 

L2PcInstance extends L2Playable which extends itself L2Character. Meaning a L2PcInstance can reuse stuff from L2Character.

L2PetInstance extends L2Summon which extends L2Playable which extends L2Character.

 

As you can see the relation between players and summons stop at L2Playable, meaning whatever you edit at and before L2Playable can affect both.

 

On another note, you can override methods content with @override. Overriden methods means you "re-write" content of the method to fit with your class.

 

To take an example, isAutoAttackable() is overriden following cases : returning always true for L2Character, but not always true for summons and players.

 

So if you don't rewrite anything it will fully inherit, but you can give exceptions to that previous statement using override.

 

Hope it's clear. If it's not, consider to use a paper and a pencil and draw a tree. I give you the beginning :

 

 

L2Pet    L2Servitor

   |         |

L2Summon           L2PcInstance

     |                             |

     ------  L2Playable ---------

                    |

                   ...

 

Edited by Tryskell
Guest
This topic is now closed to further replies.


  • Posts

    • Hi I would like to buy your panel, please reach me out from discord: doncarlo thanks in advance 🙂
    • Hi,   I am looking for experienced L2J developer who can handle Java work – systems, shops, buffer, custom features and client-side edits. Paid work. If you are interested, contact me: Discord: doncarlo
    • Hi all, I am looking for very experienced L2J developer to join and help with my Lineage 2 Interlude project (server launching soon). What I need: Build and manage shop system (manager shops) Buffer service, GM shop, custom services Good understanding of server-side (L2J) and also client-side edits Clean, stable and professional work (no random fixes) Important: Must have real experience with L2J / Interlude Must understand how to properly structure systems, not just copy-paste This is paid work, I respect your time and effort. If you are serious and experienced, contact me on Discord: doncarlo Thanks.    
    • Hey, I went through your NimeraCP and honestly, it looks really solid. Instantly bought for my server! Compared to most L2 panels, this is on a completely different level — the UI is clean, modern, and doesn’t feel like some 15-year-old system. I really like how everything is in one place — shop, referrals, rewards, roll & lucky wheel. The automation and real-time features (If you ask Splicho nicely, hahaha) are a big win too, since most panels are missing that. Overall though, great job. It feels like a next-gen panel, not just another copy. Definitely has the potential to be one of the top solutions in the L2 scene.
    • Helloo i was wonder if in interlude there is a way to increase font ui size ?  becouse sometimes when i put the game in full screen all the bars buff inventory etc are very  small  and i dont see very good .. , some one know if i can edit something in system?
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..