Standard Interfaces

前端 未结 8 833
眼角桃花
眼角桃花 2021-02-06 03:09

I\'ve used Java for some time and I keep hearing about interfaces such as Cloneable, Iterable and other X-ables.

I was wondering

8条回答
  •  误落风尘
    2021-02-06 03:35

    There are lots of interfaces, just as there are lots of classes, enums, and exceptions. If you just look at interfaces in isolation you will not see the complete picture. Some interfaces are nouns made into adjectives (-able) others are not - and the division is as much about what's sensible in English than any technical distinction.

    It's probably best to investigate in the area you are trying to solve rather than looking into what interfaces are available across the JRE - most won't make much sense until you have a specific problem scenario in mind, and look at them in context with their collaborators.

    As you are starting out, begin with interfaces in the java.lang package, then java.io, java.util, and possibly java.util.concurrent, this will give you a good grounding, and then look into specific application areas.

    Good luck!

提交回复
热议问题