No subject
Sat Nov 12 19:29:10 PST 2005
java-request at phxjug.org using -f
In-reply-to: <0FA02B923313D311B2240008C7BB98DF6A2892 at EXGIN56003>
Message-id: <NEBBLIKHDKNMGEONKBEDIECOCBAA.bing.li at asu.edu>
X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-Priority: 3 (Normal)
X-MSMail-priority: Normal
Resent-Message-ID: <"OuDJI.A.ItG.Y3-s5"@lucky>
Resent-From: java at phxjug.org
X-Mailing-List: <java at phxjug.org> archive/latest/500
X-Loop: java at phxjug.org
Precedence: list
Resent-Sender: java-request at phxjug.org
No, Sir. Course is defined in another package. Should I import it? But
actually, the Course is also an interface that needs to be implemented. I
mean if now I have tow interface as follows,
(1)
---------------------------------------------------------
package registration.interfacepkg;
public interface Course_Prototype
{
public void setID(int id);
public int getID();
public void setName(String name);
public String getName();
public void setStartDate(Date startdate);
public Date getStartDate();
public void addStudent(Student student);
public List getRoster();
public void assignInstructor(Instructor instructor);
public Instructor getInstructor();
}
(2)
----------------------------------------------------------
package registration.interfacepkg;
import java.util.*;
public interface Student_Prototype
{
public void setID(int id);
public int getID();
public void setName(String name);
public String getName();
public void addCourse(Course course);
public List getSchedule();
}
Course_Prototype and Student_Prototype are interfaces that needs to be
implemented. And I implement them in another package registration.core. They
are named as Course and Student. Now you can see Course and Student are both
needed in the interfaces. So I can't figure out how to resolve the conflict.
Thanks,
Bing
-----Original Message-----
From: Karthik,Gurumurthy [mailto:Karthikg at anz.com]
Sent: Monday, September 04, 2000 11:36 AM
To: 'bing.li at asu.edu'
Subject: RE: [java_help] I can't understand Interface
hi,
are u sure that the class Course defined in the same package as the one
indicated?
rgds
karthik
> -----Original Message-----
> From: Li Bing [SMTP:bing.li at asu.edu]
> Sent: Monday, September 04, 2000 11:59 PM
> To: damir.arh at telesat.si
> Cc: Javamug; Advanced-Java; Java_Help at Egroups. Com; JavaLearners
> Subject: FW: [java_help] I can't understand Interface
>
> -------------------------- eGroups Sponsor -------------------------~-~>
> The Five Secrets Of A Successful Product Launch
> FREE right now at:
> http://click.egroups.com/1/8592/1/_/498102/_/968092124/
> ---------------------------------------------------------------------_->
>
> Dear Sir,
>
> Now I have another question about the interface. If I need to use an
class
> that is defined by me in an interface, there is an error because the
class
> name can't be resolved.
>
> For example, in the following interface,
>
> package registration.interfacepkg;
>
> public interface Student_Prototype
> {
> public void setID(int id);
> public int getID();
> public void setName(String name);
> public String getName();
> public void addCourse(Course course);
> public List getSchedule();
> }
>
> The class, Course, is defined by me. But it can't be resolved by the
> javac.
>
> Thanks,
> Bing
>
> -----Original Message-----
> From: Damir Arh [mailto:damir.arh at telesat.si]
> Sent: Saturday, September 02, 2000 11:36 PM
> To: java_help at egroups.com
> Subject: Re: [java_help] I can't understand Interface
>
>
>
> Hello!
>
> [snip]
>
> > When compiling it, the error is as follows,
>
> > class Location_Prototype is public, should be declared in a file named
> > Location_Prototype.java
> > public interface Location_Prototypr
> > ^
>
> > I don't understand why. Anyone can help me?
>
> As the error says. You have to declare the Location_Prototype in a
> separate
> java file (Location_Prototype.java) and then import it (import
> registration.core.Location_Prototype;) in the Location.java file where
you
> declare the Location class.
>
> In java _every_ public class _has_ to be declared in a file with the same
> name as the class.
>
> Kind regards
> --
> Damir Arh, programmer
> Windows and Amiga developer
> Visit: http://damir.gajba.net/
>
>
>
> Java Help for Beginning Programmer's.
>
>
> Java Help for Beginning Programmer's.
--
To unsubscribe, send a message to java-request at phxjug.org with
"unsubscribe" in the *subject line*. If you have problems, send a
message to 'listmaster at phxjug.org'.
_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
---
To unsubscribe, mail advanced-java-unsubscribe at xcf.berkeley.edu
To get help, mail advanced-java-help at xcf.berkeley.edu
More information about the Advanced-java
mailing list