In Object Oriented programming, you'll have certain named blocks of code (usually known as methods) that you can perform on specific objects (type A), and others that you can perform on all the objects of a particular type (type B).
Example.
If I had a class called sandwich, I might have one method called getFilling and another called getBread which return me information as to whether a particular sandwich is Beef or Cheese, and whether it's on brown or white bread. These methods are both Type A as their actions will vary depending on which sandwich they're run.
However, if I have a method called getCount that returns me a total of the number of sandwiches I have, then it's going to return me the same value whether I call it on my "Beef and Stilton on White", or on a Plain cheese sandwich in brown bread. So that's an example of a Type B.
Type B methods are sometimes known as
Class methods since they apply to the class as a whole. You'll also find that Java programmers refer to them as
static methods, and Python fans call them
unbound methods since they're not attached (bound) to any particular single instance of an object.
Type A methods, then, may be known as
Object methods as they apply to an individual object,
dynamic methods as they change in behaviour depending on which particular object they're called on, or
bound methods because their behaviour is bound to a certain object.
(written 2005-10-25, updated 2011-08-18)
Associated topics are indexed under
J706 - Java - Objects and Classes [2651] Calculation within objects - early, last minute, or cached? - (2010-02-26)
[2616] Defining a static method - Java, Python and Ruby - (2010-02-01)
[2422] Looking inside Java classes - javap and javadoc - (2009-09-25)
[2169] When should I use OO techniques? - (2009-05-11)
[1925] Introduction to Object Oriented Programming - (2008-12-06)
[1906] Long, Longer, Longest in Java - (2008-11-25)
[1500] First Class Java. First step and moving forward. - (2008-01-10)
[1296] An example of Java Inheritance from scratch - (2007-08-08)
[1163] A better alternative to cutting and pasting code - (2007-04-26)
[96] Variable Scope - (2004-10-22)
Q909 - Object Orientation and General technical topics - Object Orientation: Composite Objects [3609] How do classes relate to each other? Associated Classes - (2012-02-12)
[3251] C++ - objects that are based on other objects, saving coding and adding robustness - (2011-04-17)
[3152] Jargon busting - (2011-01-30)
[3142] Private and Public - and things between - (2011-01-22)
[2922] Getting the OO design write - with PHP a example - (2010-08-14)
[2865] Relationships between Java classes - inheritance, packaging and others - (2010-07-10)
[2641] Object Oriented Programming in PHP - (2010-02-19)
[2170] Designing a heirarcy of classes - getting inheritance right - (2009-05-11)
[1348] Screw it or Glue it? Access to Object variables - a warning - (2007-09-12)
[1345] Perl and Shell coding standards / costs of an IT project - (2007-09-11)
[592] NOT Gone phishing - (2006-02-05)
Y106 - Object Oriented Python [3436] Moving from scripting to Object Orientation in Python - (2011-09-13)
[3399] From fish, loaves and apples to money, plastic cards and BACS (Perl references explained) - (2011-08-20)
[3085] Object Oriented Programming for Structured Programmers - conversion training - (2010-12-14)
[2604] Tips for writing a test program (Ruby / Python / Java) - (2010-01-29)
[2017] Python - a truly dynamic language - (2009-01-30)
[1306] Python class rattling around - (2007-08-16)
[900] Python - function v method - (2006-10-20)
[834] Python makes University Challenge - (2006-08-15)
Y112 - Python - Objects - Intermediate [3524] Metaclasses (Python) and Metatables (Lua) - (2011-11-17)
[3472] Static variables in functions - and better ways using objects - (2011-10-10)
[3442] A demonstration of how many Python facilities work together - (2011-09-16)
[3002] A list of special method and attribute names in Python - (2010-10-17)
[2994] Python - some common questions answered in code examples - (2010-10-10)
[2905] Defining static methods in Python - (2010-08-05)
[2889] Should Python classes each be in their own file? - (2010-07-27)
[2785] The Light bulb moment when people see how Object Orientation works in real use - (2010-05-28)
[2764] Python decorators - your own, staticmethod and classmethod - (2010-05-14)
[2722] Mixins example in Python - (2010-04-14)
[2720] Multiple inheritance in Python - complete working example - (2010-04-14)
[2717] The Multiple Inheritance Conundrum, interfaces and mixins - (2010-04-11)
[2693] Methods that run on classes (static methods) in Python - (2010-03-25)
[2485] How do I set up a constant in Python? - (2009-10-31)
[2409] TypeError: super() argument 1 must be type, not classobj (Python) - (2009-09-18)
[2368] Python - fresh examples of all the fundamentals - (2009-08-20)
[1819] Calling base class constructors - (2008-10-03)
[1661] Equality, sameness and identity - Python - (2008-05-31)
[1644] Using a utility method to construct objects of different types - Python - (2008-05-17)
[1517] Python - formatting objects - (2008-01-24)
[1217] What are factory and singleton classes? - (2007-06-04)
[1146] __new__ v __init__ - python constructor alternatives? - (2007-04-14)
[964] Practical polymorphism in action - (2006-12-04)
[903] Pieces of Python - (2006-10-23)
[831] Comparison of Object Oriented Philosophy - Python, Java, C++, Perl - (2006-08-13)
[656] Think about your design even if you don't use full UML - (2006-03-24)
[383] Overloading of operators on standard objects in Python - (2005-07-19)
[296] Using a Python dictionary as a holder of object attributes - (2005-04-30)
Some other Articles
PHP upgrade - traps to watchNew look to websiteNew servlet from oldWatch what you wearClass, static and unbound variablesMay I be politically incorrect?Where to stay in and near MelkshamVintage Bus DayLooking different in townAre you free on 29th October - Charity ball