Program to demonstrate Interface in Java

Program to demonstrate Interface in Java


interface NewShape
{
    void draw();
}

interface Circle extends NewShape
{
    void getRadius();
    int radious=10;
}

class NewCircle implements Circle
{
    public void getRadius()
    {
        System.out.println(radious);
    }
}
class ExtendInterface extends NewCircle
{
    public static void main(String args[])
    {
        Circle nc=new NewCircle();
        nc.getRadius();
    }
}


         //NewCircle is not abstract and does not override abstract method draw() in NewShape

1 comments:

Anonymous said...

goyard outlet
bapesta shoes
bape
fear of god essentials hoodie
off white clothing
a bathing ape
kyrie irving shoes
kyrie 8 shoes
hermes
hermes bag

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|