Dalvik has this well-known limitation on the number of methods it can have in a single .dex
file (about 65,536 of them). My question is whether inherited (but not overridden) methods count against this limit or not.
To make things concrete, suppose I have:
public class Foo {
public int foo() {
return 0;
}
}
public class A extends Foo { }
public class B extends Foo { }
public class C extends Foo { }
For the purposes of the 65,536 method limit, does this count as adding one method, or adding 4? (Or, I guess, to take things to their logical conclusion, does this count as 1 method or 52 methods, considering that java.lang.Object
brings 12 methods along too).
As background, I've got a non-trivial number of generated classes with some commonality, and I'm also bumping up against the method limit, so I'm wondering if it's worthwhile to try to abstract some of those out into a class hierarchy in order to buy some time.