Question:

Java:wat does collection of method declarations actually mean in interface.plz help

by  |  earlier

0 LIKES UnLike

iam new to java..can anyone tel me wats wrong in dis program..plz explain..

interface area

{

final float pi=3.14F;

float cal(float x,float y);

float c(float r);

}

abstract class rectangle implements area

{

public float cal(float x,float y)

{

return x*y;

}

}

class circle implements area

{

public float c(float r)

{

return pi*r*r;

}

}

class inf

{

public static void main(String args[])

{

rectangle r=new rectangle();

circle ci=new circle();

area area1;

area1=r;

System.out.println(area1.cal(9,8));

area1=ci;

System.out.println(area1.c(8));

}

}

 Tags:

   Report

2 ANSWERS


  1. Oh my!, where to begin.  I guess I won't begin, I am inclined to support mr. the_rock and suggest that you do some reading.  

    However here is a hint, you will need to create several files for this to work;

    your interface file and your inf file.


  2. it means you should read a book on java first

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.