Qus:    How can we access some class in another class in Java?
May 29, 2021 09:32 1 Answers Views: 18 VAMSI
Prev Next
Answers (1)
RANJIT Jun 01, 2021 02:23
Answer:   There are two ways to access a class in another class.
1)By using the fully qualified name: To access a class in a different package, either we must use the fully qualified name of that class, or we must import the package containing that class.
2)By using the relative path : We can use the path of the class that is related to the package that contains our class. It can be the same or sub package.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect