Interview Questions - Java Basics
Yes the imports are checked for the semantic validity at compile time. The code containing above line of import will not compile. It will throw an error saying, can not resolve symbol
symbol : class ABCD
location: package io
In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization.
Example: String s; is just a declaration while String s = new String ("abcd"); Or String s = "abcd"; are both definitions.