What is the significance of '*' while importing a package?
Answers
Answered by
9
Using (*) asterisk wildcard character in the import statement will all the available types consist of a particular package.
Explanation:
If you import java.io.* the compiler will look at all classes in the java.io package when it needs to find a class you are using.
It means you import the class which is included in Java Input Output package those class which is used in our implementation class like FileOutputStream, FileReader, etc.
Similar questions
Math,
6 months ago
Science,
6 months ago
Science,
6 months ago
Math,
1 year ago
Social Sciences,
1 year ago