Welcome to Dream.In.Code
Become a Java Expert!

Join 149,495 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,343 people online right now. Registration is fast and FREE... Join Now!




circle intersection

 
Reply to this topicStart new topic

circle intersection, i have to create a program that intersects 2 circles in color

prit876
18 Mar, 2007 - 06:44 PM
Post #1

New D.I.C Head
*

Joined: 7 Mar, 2007
Posts: 5


My Contributions
CODE

import java.awt.Graphics2D;
import java.awt.Color;
import java.awt.geom.Ellipse2D;
//Circle.java

public class Circle
{
        //Circle's radius
        private double radius();
        
        //instance variables of the circle's center
        public double x,y;
        Color blue = g2.fill(circle);
        
        //constructor
        public Circle( double radiusValue )
        {
            setRadius( radiusValue );
        }
        
        //set radius
        public void setRadius( double radidusValue )
        {
            radius = radius;
        }
        
        //return radius
        public double getRadius()
        {
            return radius;
        }
        
        //calculate and return circumference
        public double getCircumference()
        {
            return Math.PI * getRadius() * 2;
        }
        
        //calculate and return circle's area
        public double getArea()
        {
            return Math.PI * getRadius() * getRadius();
        }
        
} //end class Circle    


i keep getting this error by the fill method and it keeps saying that i need an identifier.. I tried everything and nothing seems to be working
User is offlineProfile CardPM
+Quote Post

horace
RE: Circle Intersection
18 Mar, 2007 - 11:12 PM
Post #2

D.I.C Addict
Group Icon

Joined: 25 Oct, 2006
Posts: 573



Thanked: 5 times
Dream Kudos: 50
My Contributions
a couple of immediate errors
CODE

public class Circle
{
        //Circle's radius
        private double radius();                  << looks like a function call remove the () ??
        
        //instance variables of the circle's center
        public double x,y;
        Color blue = g2.fill(circle);             << executable statement outside a method
        


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 06:07PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month