Will the following code work.
will the following code work?--XYZ classpackage abc.def;public class XYZ {-}-PQR class--package mno;import abc.*;class PQR{ def.XYZ x = new def.XYZ(); //is this line ok!}
> I was doing an excercise in a book(objective> questions)> The book says it is wrong, but according to me it> should work.It doesn't work, that's why I told you to read about packages and imports.Kaj
That means whenever we import packages, then only the classes in that package are resolved.
Package names are not resolved.
I took it as a file system, whenever we are in a directory, then all file names and subdirectory names are resolved (although contents of subdirectory are not resolved).
Thanks! I got my answer!