Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Understanding Packages
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="shaun, post: 616965"] 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 [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Understanding Packages
Top