1.

Are The Imports Checked For Validity At Compile Time? E.g. Will The Code Containing An Import Such As Java.lang.abcd Compile?

Answer»

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, cannot RESOLVE symbol

symbol: class ABCD

location: PACKAGE io

import java.io.ABCD;

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, cannot resolve symbol

symbol: class ABCD

location: package io

import java.io.ABCD;



Discussion

No Comment Found