Forums Register Login

cannot find symbol

+Pie Number of slices to send: Send
Dear friend,
I have a class and I want to use a method from another class. e.g.: I want to call method X of class A from inside of class B.
So I write A.x() inside class B. I also import package.A inside of class B. but it throws me this error:

DB is the package name, DbHistory is the class name and PsUpdate is the method name:

I dont know how netbean can not recognize it because when I wrote "Db." netbean automatically gave me the method name "PsUpdate"!!
do you know what is wrong?

Thanks,
Sahar.
+Pie Number of slices to send: Send
 

sahar sa wrote:
I dont know how netbean can not recognize it because when I wrote "Db." netbean automatically gave me the method name "PsUpdate"!!
do you know what is wrong?



Is PsUpdate() a static method? Because if it isn't, you can't call it without an instance.

Henry
+Pie Number of slices to send: Send
It isn't complaining about PsUpdate, it thinks that DB.DbHistory is a field of class DB instead of class DbHistory inside package DB. The problem is your class name; it is called DB as well. So DB is the package but also the class name. The compiler will use the nearest scope, and that is the class.

Change your package name from DB to db and your problem will go away.
+Pie Number of slices to send: Send
Thanks, problemo solved!
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 986 times.
Similar Threads
package org.apache.commons.httpclient does not exist
Class Cast related query
Please fix this code..............urgent......some minor errors in compiling
What is the error?
select .... where... query for a variable?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:12:58.