i have below doubt on import statement in java.
package com.punith.test; import **com.punith.test.classa**; public class classa { } so in above code allowed import same class defining classa. why did designers allowed this, instead of compilation error corrected warning.
regards punith
it's special case of unused import, quite rightly don't throw compile errors. there no performance hit unused imports since compile-time indicator intend use class @ runtime.
there countless ways create pointless code; have each 1 throw compile time error make compiler considerably more complex. best rely on element of common sense developer , when common sense fails (all often), optimise out dodgy code - happens in case.
Comments
Post a Comment