The Artima Developer Community
Sponsored Link

Java Answers Forum
Java-Packages

2 replies on 1 page. Most recent reply: Jun 9, 2004 4:35 AM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
reDaktor

Posts: 1
Nickname: jeditor
Registered: Jun, 2004

Java-Packages Posted: Jun 5, 2004 8:03 AM
Reply to this message Reply
Advertisement
I have a Question about packages.I created four diffirent public classes defined with: package mtj.level1 .
But when i tried to create an attribute of :Class1 in Class2 it donĀ“t recognize the name.
error:

Class2.java:5: cannot resolve symbol
symbol : class Class1
location: class mtj.level1.Aufg03
public static GenStation g1 ;
^


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Java-Packages Posted: Jun 9, 2004 3:09 AM
Reply to this message Reply
If your four classes

Class1, Class2, Class3, Class4 are in the same package,

u can access Class1 in Class2.

Check that the classes are there in the class path

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Java-Packages Posted: Jun 9, 2004 4:35 AM
Reply to this message Reply
I had to implement the same excercise six years ago (I suppose the only difference is you use swing instead of awt).
This is from Level4, but it should do the trick.

//Class mtj.level4GenStation:
package mtj.level4
public abstract class GenStation extends Station implements EventGenerator {...}

//Class Aufg08, no package
public class Aufg08 {
//Use mtj.level1.GenStation to access the GeneratorStation.
}

Flat View: This topic has 2 replies on 1 page
Topic: Covert milliseconds to time/date Previous Topic   Next Topic Topic: convert an int into a byte array

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use