S
shaun
Hi,
I am reading Ivor Horton's Beginning Java 2. I have the following
package setup:
C:\Java\Packages\Geometry
In this directory I have 2 classes:
Line.java
Point.java
These classes have compiled correctly. I have created a directory in
geometry called Shape2D and in this directory created a file called
Rectangle.java, here are the contents:
package Geometry.Shape2D;
public class Rectangle {
// Data members
private Point topLeft;
private Point bottomRight;
// Create a rectangle from two points
public Rectangle(final Point topLeft, final Point bottomRight) {
this.topLeft = new Point(topLeft);
this.bottomRight = new Point(bottomRight);
}
}
When I try to compile this program i get the foillowing error:
C:\Java\Packages\Geometry\Shape2D>javac -classpath
".;C:\Java\Packages\Geometry"
Rectangle.java
Rectangle.java:5: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
private Point topLeft;
^
Rectangle.java:6: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
private Point bottomRight;
^
Rectangle.java:9: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
public Rectangle(final Point topLeft, final Point bottomRight) {
^
Rectangle.java:9: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
public Rectangle(final Point topLeft, final Point bottomRight) {
^
Rectangle.java:10: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
this.topLeft = new Point(topLeft);
^
Rectangle.java:11: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
this.bottomRight = new Point(bottomRight);
^
6 errors
As you can probably tell I am a beginner so any tips here would be
greatly appreciated.
Shaun
I am reading Ivor Horton's Beginning Java 2. I have the following
package setup:
C:\Java\Packages\Geometry
In this directory I have 2 classes:
Line.java
Point.java
These classes have compiled correctly. I have created a directory in
geometry called Shape2D and in this directory created a file called
Rectangle.java, here are the contents:
package Geometry.Shape2D;
public class Rectangle {
// Data members
private Point topLeft;
private Point bottomRight;
// Create a rectangle from two points
public Rectangle(final Point topLeft, final Point bottomRight) {
this.topLeft = new Point(topLeft);
this.bottomRight = new Point(bottomRight);
}
}
When I try to compile this program i get the foillowing error:
C:\Java\Packages\Geometry\Shape2D>javac -classpath
".;C:\Java\Packages\Geometry"
Rectangle.java
Rectangle.java:5: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
private Point topLeft;
^
Rectangle.java:6: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
private Point bottomRight;
^
Rectangle.java:9: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
public Rectangle(final Point topLeft, final Point bottomRight) {
^
Rectangle.java:9: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
public Rectangle(final Point topLeft, final Point bottomRight) {
^
Rectangle.java:10: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
this.topLeft = new Point(topLeft);
^
Rectangle.java:11: cannot find symbol
symbol : class Point
location: class Geometry.Shape2D.Rectangle
this.bottomRight = new Point(bottomRight);
^
6 errors
As you can probably tell I am a beginner so any tips here would be
greatly appreciated.
Shaun