Hello,
I was trying to get hold of arrays and read lots of stuff.
So when i started coding, i got an error message saying incompatible types. I checked with general compliance and it should be ok. Maybe netbeans causing it?
Anyway, any kind of help will be appreciated
public class Point implements Cloneable
{
// instance variables
double points [];
double x;
double y;
/**
* Constructor for objects of class Position
*/
public Point() // This is a no-argument constructor
{
// initialise instance variables to zero
double points [] = {0, 0};
double x = 0;
double y = 0;
}
/**
* setLocation()
* This method sets initial location of a point in 2D
*
* @param x,y all doubles
* @return array points
*/
public double setLocation( double x, double y)
{
// Temporary variables that take values from the user input
points [0] = x;
points [1] = y;
System.out.println("Initial location of points is: " + points);
return points;
}
}