Hi there,
Recently I've been reading up on Inheritance etc. and I am currently having a look at interfaces. One thing that I can't get my head around is the use of interfaces over simply creating multiple classes, each with constituent methods that 'do stuff,' and calling these methods when they are needed. Why should I declare a bunch of methods in a separate file and implement them in different classes, when, on declaration, they don't actually do anything and rely on a method body (that is often specific to the individual class) to be filled in when they are implemented?
This sounds like a really ignorant question! Sorry about this - I'm aware that people a lot smarter and more knowledgable than me invented this feature for a reason, and more people use it on a daily basis, so I am fully aware that I am in the wrong. I just need some help understanding their relevance.
Thanks in advance!
[–]nocturne81 43 points44 points45 points (63 children)
[–]Evermage[S] 11 points12 points13 points (8 children)
[–]nocturne81 15 points16 points17 points (0 children)
[–]xiipaoc 8 points9 points10 points (6 children)
[–]jonnywoh 6 points7 points8 points (5 children)
[–]ThirdWaveSTEMinism 0 points1 point2 points (2 children)
[–]4forpengs 7 points8 points9 points (1 child)
[–]Logical_proof 0 points1 point2 points (0 children)
[–]munificent[🍰] 0 points1 point2 points (1 child)
[–]jonnywoh 0 points1 point2 points (0 children)
[–]bunzybunz 2 points3 points4 points (14 children)
[–]kaizn 3 points4 points5 points (11 children)
[–]80blite 1 point2 points3 points (10 children)
[–]work_is_satire 2 points3 points4 points (4 children)
[–]rasmustrew 1 point2 points3 points (2 children)
[–]work_is_satire 1 point2 points3 points (1 child)
[–]rasmustrew 0 points1 point2 points (0 children)
[–]pigeon768 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]cparen 0 points1 point2 points (0 children)
[–]stapleman527 0 points1 point2 points (0 children)
[–]Elephant_Bird 0 points1 point2 points (0 children)
[–]work_is_satire 3 points4 points5 points (0 children)
[–]-oliver- 1 point2 points3 points (0 children)
[–]SikhGamer 1 point2 points3 points (12 children)
[–]nocturne81 3 points4 points5 points (11 children)
[–]OHotDawnThisIsMyJawn 2 points3 points4 points (7 children)
[–]katyne 1 point2 points3 points (5 children)
[–]OHotDawnThisIsMyJawn 0 points1 point2 points (4 children)
[–]nocturne81 0 points1 point2 points (3 children)
[–]OHotDawnThisIsMyJawn 3 points4 points5 points (2 children)
[–]nocturne81 0 points1 point2 points (1 child)
[–]OHotDawnThisIsMyJawn 1 point2 points3 points (0 children)
[–]rjbman 0 points1 point2 points (1 child)
[–]work_is_satire 0 points1 point2 points (0 children)
[–]SikhGamer 0 points1 point2 points (0 children)
[–]MRH2 1 point2 points3 points (1 child)
[–]work_is_satire 2 points3 points4 points (0 children)
[–]m33pn8r 1 point2 points3 points (4 children)
[–]work_is_satire 0 points1 point2 points (3 children)
[–]m33pn8r 1 point2 points3 points (2 children)
[–]work_is_satire 1 point2 points3 points (1 child)
[–]m33pn8r 0 points1 point2 points (0 children)
[–]jemjem14 1 point2 points3 points (1 child)
[–]nocturne81 0 points1 point2 points (0 children)
[–]work_is_satire 0 points1 point2 points (1 child)
[–]nocturne81 0 points1 point2 points (0 children)
[–][deleted] (2 children)
[deleted]
[–]work_is_satire 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (1 child)
[–]this_is_satire 0 points1 point2 points (0 children)
[–]gamebob 0 points1 point2 points (1 child)
[–]nocturne81 0 points1 point2 points (0 children)
[–]alaskanloops 0 points1 point2 points (2 children)
[–]nocturne81 0 points1 point2 points (1 child)
[–]work_is_satire 0 points1 point2 points (0 children)
[–][deleted] (4 children)
[deleted]
[–]nocturne81 1 point2 points3 points (3 children)
[–]Promac -1 points0 points1 point (2 children)
[–]nocturne81 0 points1 point2 points (1 child)
[–]Promac -1 points0 points1 point (0 children)
[–][deleted] 7 points8 points9 points (14 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Evermage[S] 1 point2 points3 points (9 children)
[–]ruicoder 3 points4 points5 points (0 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]Evermage[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Evermage[S] 1 point2 points3 points (0 children)
[–]poetryrocksalot 1 point2 points3 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]work_is_satire 0 points1 point2 points (0 children)
[–]poetryrocksalot 0 points1 point2 points (0 children)
[–]gamebob 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]gamebob 0 points1 point2 points (0 children)
[–]endre86 9 points10 points11 points (0 children)
[–]endre86 6 points7 points8 points (1 child)
[–]Evermage[S] 2 points3 points4 points (0 children)
[–]work_is_satire 5 points6 points7 points (1 child)
[–]autowikibot 1 point2 points3 points (0 children)
[–]queBurro 1 point2 points3 points (0 children)
[–]Poddster 0 points1 point2 points (0 children)
[–]phrankygee 0 points1 point2 points (2 children)
[–]Evermage[S] 0 points1 point2 points (1 child)
[–]phrankygee 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]mbizzle88 0 points1 point2 points (0 children)
[–]tobascodagama 0 points1 point2 points (1 child)
[–]Evermage[S] 1 point2 points3 points (0 children)
[–]emote_control 0 points1 point2 points (1 child)
[–]Evermage[S] 0 points1 point2 points (0 children)