Results 1 to 3 of 3
  1. #1
    Javasubbu is offline Member
    Join Date
    Oct 2011
    Posts
    19
    Rep Power
    0

    Default nested Interfaces

    I am practicing nested interfaces..I am missing out somewhere in the code. Can some one help..Below are the codes...

    Java Code:
    public class Aint {
    	public interface notIf{
    	boolean	ifNotPos(int i);
    }
    }
    and

    Java Code:
    class Bint implements Aint.notIf{
    	public boolean notIfPos(int i){
    		return i < 0 ? false : true;
    }
    }
    and the main program 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));	
    }
    }
    When I compile the error that I get is,

    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
    Can someone help...?

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: nested Interfaces

    Check the method names.

  3. #3
    Javasubbu is offline Member
    Join Date
    Oct 2011
    Posts
    19
    Rep Power
    0

Similar Threads

  1. Interfaces
    By dalu in forum New To Java
    Replies: 4
    Last Post: 04-26-2011, 12:22 PM
  2. Replies: 20
    Last Post: 03-22-2011, 04:02 AM
  3. Interfaces
    By blug in forum New To Java
    Replies: 3
    Last Post: 03-08-2011, 04:01 AM
  4. Interfaces
    By jon80 in forum New To Java
    Replies: 2
    Last Post: 05-03-2008, 09:57 PM
  5. interfaces..
    By sireesha in forum New To Java
    Replies: 5
    Last Post: 01-16-2008, 05:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •