|
-
error Cal(int, int) in Cal cannot be applied to ()
Hi I get this error Cal(int, int) in Cal cannot be applied to ()
No idea whats going on.
class Cal{
private int base;
private int height;
private int total;
public Cal(int b,int h){
base=b;
height=h;
}
public void setHeight(int num){
height=num;
}
public void setBase(int num){
base=num;
}
public void getTotal(){
System.out.println("Area of a Rectangle is " +base*height);
}
}
//====================================================
class Cal2 extends Cal{
private int radius;
private int total2;
Cal2(int r){
radius = r;
}
public void setRadius(int num){
radius=num;
}
public void getTotal2(){
System.out.println("Area of a circle is " +3.14*radius*radius);
}
}
//=================================================
public class Inheritance4{
public static void main (String[] args){
Cal areaRectangle =new Cal(3,4);
Cal2 areaCircle =new Cal2(4);
areaRectangle.getTotal();
}
}
Similar Threads
-
By lordanki in forum Java
Replies: 3
Last Post: 04-04-2006, 10:13 AM
-
By xsouldeath in forum Java
Replies: 0
Last Post: 12-10-2005, 10:56 PM
-
By mdengler in forum ASP.NET
Replies: 0
Last Post: 11-26-2002, 02:32 PM
-
Replies: 6
Last Post: 04-10-2002, 05:22 AM
-
Replies: 1
Last Post: 07-04-2001, 05:18 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks