On Feb 17, 4:52 am, Cecil Haertel III <[email protected]> wrote:
> Has any done these (especially the classpath ) exercises on Linux (Ubuntu).
> If so can you explain how to get past the last exercise/lab. When you
> introduce the DummyClass object, and import the "anotherpackage" into
> StudentRecord.
I'm not sure I understand your question. Or are there two questions?
If you speak about lab 1014 Exercise 6.2-3, to get past the compile
errors, it is sufficient to introduce public getters for variables in
the imported classes, and to use those getters in the targeted class.
For method, you have to change modifier to public or protected
depending if classes or in the same package or not.
There is a very good reference about modifiers and their effects on
Sun site, referenced from the lab resources as pre-reading material,
especially this section:
http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html
You may use the refactor facility in NetBeans to let it writing
getters and setters for you.
>
> Everything worked fine until I did this. Now I can't get past the compile
> phase because StudentRecord throws a class not found error.
As for the homework, if you define public getters and setters in
StudentRecord, and use them in StudentRecordExample, you should not
have any problem, though I don't see any references to dummy class in
it, unless I've missed something obvious or completely misunderstood
the lab number (could you provide it systematically in the post
object, please).

Also, paste the error.
>
> Thanks,
> Trey

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to