From khalid's mock exam Given:- interface I{ void setValue(int val); int getValue(); } Definition a: abstract class C implements I{ int getValue(){return 0;} abstract vid increment(); }
Can we create class c using interface I I feel we can create because class c is defined abstract. Am I right
Hi Chaitaili, The example will fail because Interface methods are implicitly public. Class C is providing only package access for <code>int getValue()</code>. Overriding methods cannot have lower access privileges than the original method. Hope that helps. ------------------ Jane Griscti Sun Certified Java 2 Programmer
hi r u a mumbaite we r making a forum for mumbaites those preparing for scjp. so that we can exchange notes,codes,and our experience. check out the topic by me titled "anyone planning to appear for scjp in march" regds nav