----- Original Message -----
Sent: Monday, September 24, 2001 4:48
PM
Subject: Re: possible idiot
question
thanks very much for you reply, but i think that is
what i have done with the declaration...
package com.wrox.library;
in
both of the classes, as i understand it a package is euphanism for
directory, would that be correct.
as
you will gather this is a wrox tut
i
have pasted the code below for anyone who is interested:
initial class:
*******************************************************
package com.wrox.library;
public class Book {
private String
title;
public String getTitle()
{
return
title;
}
public void setTitle (String title)
{
this.title =
title;
}
/** Creates new Book: Constructor */
public Book ()
{
}
public Book (String title) {
this.title =
title;
}
}
*******************************************************
extension class:
*******************************************************
package com.wrox.library;
public class ChildrensBook extends Book
{
private int
minimumAge;
public int
getMinimumAge() {
return
minimumAge;
}
public void setMinimumAge(int a)
{
minimumAge =
a;
}
public ChildrensBook() {
super();
}
public ChildrensBook(String title)
{
super(title);
}
}
*******************************************************
once again thanks to anyone who is willing to
assist me...
ewan taylor
In both classes u have to declare the package
to which that class belong. That may solve u r problem.
happy coding
----- Original Message -----
Sent: Monday, September 24, 2001
4:27 PM
Subject: possible idiot
question
i am trying
to get my head around class inheritance and have followed some tuts,
however....
having
created a simple class, and then creating a subclass, extending the
first, i keep getting
Class Book not found
in type declaration or import...
when i try
to compile it, they are both sitting in the same package.... pls help!!
this is giving me a headache.
i am
currently running Sun's Forte IDE with JDK1.3.1 and serving it up with
Tomcat 4.0
forte
suggests that i have an invalid package declaration but i can find no
documentation on how to rectify this, and am baffled as i have followed
the tuts to the letter and nothing seems out of
kilter.
any help
will be gratefully recieved...
cheers..
ewan
taylor
========================= To unsubscribe:
mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For
digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST". Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=P
http://www.jguru.com/jguru/faq/faqpage.jsp?name=rvlets
========================= To unsubscribe: mailto
[EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto
[EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant
FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=P
http://www.jguru.com/jguru/faq/faqpage.jsp?name=rvlets