Re: compile javac help needed for beginner. apparently it doesnot understand the word extends?????
From: frabi (frabi007_at_gmx.de)
Date: 01/20/04
- Next message: Andrew Thompson: "Re: How to pass output stream to method (JSP)?"
- Previous message: Andrew Thompson: "Re: SpringLayout and Regex Tool"
- In reply to: George Kooper: "compile javac help needed for beginner. apparently it doesnot understand the word extends?????"
- Next in thread: Thomas Schodt: "Re: compile javac help needed for beginner. apparently it doesnot understand the word extends?????"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 20 Jan 2004 15:45:50 +0100
George Kooper <tentimes5@hotmail.com > schrieb in im Newsbeitrag:
4ldq00d2n88dp6p795fbenh962fgsh331f@4ax.com...
> I have installed Java from Sun site to my Windows XP .
>
> I have modified the PATH statement to include:
> C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program
> Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program
> Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft
> VisualStudio\VC98\bin;C:\j2sdk1.4.2_03\bin;
>
>
> I have 2 files in my directory:
> Person.class:
> class Person {
> String name;
> int age;
> }
>
> and
> Customer.java:
> class Customer extends Person {
> // Inherits name and age
> // automatically from Person
> int custId;
> String phone;
> }
>
> I compile Person.java
> and get good compile:
> D:\javaschool\Labs\02_JavaDataTypes\Starter>javac Person.java
>
>
>
> but when I compile Customer.java; I get error.
> D:\javaschool\Labs\02_JavaDataTypes\Starter>javac Customer.java
> Customer.java:1: cannot resolve symbol
> symbol : class Person
> location: class Customer
> class Customer extends Person {
> ^
> 1 error
>
> apparently it doesnot understand the word extends?????
>
> Thanks
Hi!
I think you should make both classes Public, so they can be seen from
outside of the source files:
public class Persion {
....
}
and
public class Cusomer {
....
}
now the class Customer sould be able to access class Person.
Surprisingly i could compile both files with jdk1.3.1. what version do you
use?
best regards
alex
- Next message: Andrew Thompson: "Re: How to pass output stream to method (JSP)?"
- Previous message: Andrew Thompson: "Re: SpringLayout and Regex Tool"
- In reply to: George Kooper: "compile javac help needed for beginner. apparently it doesnot understand the word extends?????"
- Next in thread: Thomas Schodt: "Re: compile javac help needed for beginner. apparently it doesnot understand the word extends?????"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|