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?
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.