[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Import Problem



this isn't appropriate list to ask this ques.

check the dirs where the files lie.   put first file in MyPack dir & second one in parent of MyPack  . then 
may it work.

_______
deepak

At 11/11/00 6:58:00 PM, you wrote:
>Hi
>
>I am trying to use packages. I have 2 classes
>
>1)Balance.java
>
>package MyPack;
>public class Balance
>{
>        String name;
>        double bal;
>
>        public Balance(String n, double b)
>        {
>                name = n;
>                bal = b;
>        }
>
>        public void show()
>        {
>                if(bal<0)
>                        System.out.print("--> ");
>                System.out.print(name + ": $" + bal);
>        }
>
>}
>
>2)TestBalance.java
>
>import MyPack.*;
>class TestBalance
>{
>        public static void main(String args[])
>        {
>                Balance test = new Balance("Heston",
>99.99);
>                test.show();
>        }
>}
>
>
>The Balance.java compiles OK. But when I try and
>compir the TestBalance.java file I get the following
>errors
>
>TestBalance.java:1: package MyPack does not exist
>import MyPack.*;
>^
>TestBalance.java:7: cannot resolve symbol
>symbol  : class Balance
>location: class TestBalance
>                Balance test = new Balance("Heston",
>99.99);
>                ^
>TestBalance.java:7: cannot resolve symbol
>symbol  : class Balance
>location: class TestBalance
>                Balance test = new Balance("Heston",
>99.99);
>                                   ^
>3 errors
>
>Could someone help me out. The JVM is on a linux
>machine
>
>Regards
>
>Heston
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Calendar - Get organized for the holidays!
>http://calendar.yahoo.com/
>
>---------------------------------------------
>LIP is all for free speech.  But it was created
>for a purpose.  Violations of the rules of
>this list will result in stern action.
>
>

-----------------------------
reply soon
bye

 ==== D ee p a K ----

have a great day 
ICQ 30662394

-- The zebra is chiefly used to illustrate the letter Z.