23. interface addable { Object add(Object b);} class X implements addable { public Object add(Object b) { return new Object(); // Test } } class AddableNotFoundException extends Exception {} public class WeakTyping { public static Object sum(Object a, Object b) throws AddableNotFoundException { Class[] intfs = a.getClass().getInterfaces(); for(int i = 0; i < intfs.length; i++) if(intfs[i] == addable.class) return ((addable)a).add(b); throw new AddableNotFoundException(); } public static void main(String[] args) throws Exception { X a = new X(); X b = new X(); Object c = sum(a, b); } }
24.
25.
26.
27.
28.
29. Life is Short (You Need Python) OR: No Warrantee Not Fit for Any Particular Purpose (You Need Python)