can we acess a pakage out of its class? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can we acess a pakage out of its class?

4th Sep 2016, 3:24 PM
Parsa Lalith
Parsa Lalith - avatar
1 Answer
+ 3
Do you mean can we access a class outside of a certain package ? If thats the case then yes you can. The step to access a class in a different package is basically: import packageName.className; This will import solely the targetted class. or import packageName.*; This will import all classes thats within that particular package.
4th Sep 2016, 3:51 PM
Ousmane Diaw