0

Why you have to import things in Java if they seem too already be there?

31st Oct 2019, 11:54 AM
Weyloarn
Weyloarn - avatar
3 Respostas
0
For example if there is a class Vehicle in package1 of your 1st Java project and you want to extend that class to create a class Car which is in some package of your 2nd Java project, then in such cases you need an import statement. This is just one of the examples.
31st Oct 2019, 1:46 PM
Avinesh
Avinesh - avatar
0
Only classes found in other packages are imported.
31st Oct 2019, 2:10 PM
Juan Debenedetti
Juan Debenedetti - avatar
0
You can import interface as well.
31st Oct 2019, 2:21 PM
Avinesh
Avinesh - avatar