Hi, Experts,
I'm new to jsp and javabean. I have a very simple base class Book.java and a subclass TechnicalBook.java. The file structure is as follows:
%CATALINA_HOME%\webapps\test\WEB-INF\classes\booklibrary\Book.java
%CATALINA_HOME%\webapps\test\WEB-INF\classes\booklibrary\TechnicalBook.java
Here is the code of Book.java:
And here is the subclass:
The base class was compiled ok. But the subclass does not complie:
BTW, I am using jdk 1.5 on win xp. Thank you very much for your help.
I'm new to jsp and javabean. I have a very simple base class Book.java and a subclass TechnicalBook.java. The file structure is as follows:
%CATALINA_HOME%\webapps\test\WEB-INF\classes\booklibrary\Book.java
%CATALINA_HOME%\webapps\test\WEB-INF\classes\booklibrary\TechnicalBook.java
Here is the code of Book.java:
Code:
package booklibrary;
public class Book
{
private String title;
public String getTitle()
{
return title;
}
public void setTitle(String newTitle)
{
this.title = newTitle;
}
public Book(String title)
{
this.title = title;
}
}
And here is the subclass:
Code:
package booklibrary;
public class TechnicalBook extends Book
{
private String skillLevel;
public String getSkillLevel()
{
return this.skillLevel;
}
public void setSkillLevel(String s)
{
this.skillLevel = s;
}
public String toString()
{
return getTitle();
}
public TechnicalBook(String title)
{
super(title);
}
}
The base class was compiled ok. But the subclass does not complie:
Code:
%CATALINA_HOME%\webapps\test\WEB-INF\classes>javac booklibrary\TechnicalBook.java
booklibrary\TechnicalBook.java:3: cannot find symbol
symbol: class Book
public class TechnicalBook extends Book
^
booklibrary\TechnicalBook.java:20: cannot find symbol
symbol : method getTitle()
location: class booklibrary.TechnicalBook
return getTitle();
^
2 errors
BTW, I am using jdk 1.5 on win xp. Thank you very much for your help.