Results 1 to 3 of 3
Thread: nested Interfaces
- 10-25-2011, 12:51 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 19
- Rep Power
- 0
nested Interfaces
I am practicing nested interfaces..I am missing out somewhere in the code. Can some one help..Below are the codes...
andJava Code:public class Aint { public interface notIf{ boolean ifNotPos(int i); } }
and the main program isJava Code:class Bint implements Aint.notIf{ public boolean notIfPos(int i){ return i < 0 ? false : true; } }
When I compile the error that I get is,Java Code:class Cint{ public static void main(String args[]){ Aint.notIf a1 = new Bint(); System.out.println("The value is " + a1.ifNotPos(10)); System.out.println("The value is " + a1.ifNotPos(-12)); } }
Can someone help...?Java Code:C:\Subbu\Java>javac Cint.java .\Bint.java:1: error: Bint is not abstract and does not override abstract method ifNotPos(int) in notIf class Bint implements Aint.notIf{ ^ 1 error
- 10-25-2011, 01:04 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,545
- Rep Power
- 11
Re: nested Interfaces
Check the method names.
- 10-25-2011, 01:14 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 19
- Rep Power
- 0
Similar Threads
-
Interfaces
By dalu in forum New To JavaReplies: 4Last Post: 04-26-2011, 12:22 PM -
[Semi-Beginner] (nested loops) What's wrong with my code? (nested loops)
By Solarsonic in forum New To JavaReplies: 20Last Post: 03-22-2011, 04:02 AM -
Interfaces
By blug in forum New To JavaReplies: 3Last Post: 03-08-2011, 04:01 AM -
Interfaces
By jon80 in forum New To JavaReplies: 2Last Post: 05-03-2008, 09:57 PM -
interfaces..
By sireesha in forum New To JavaReplies: 5Last Post: 01-16-2008, 05:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks