java - Are Imports and Libraries the same? -
so kind of confused, righting dissertation software made , wondering while explaining code if imports used in each class "import java.io.ioexception;" in same moment libraries? or libraries else?
a java library jar file containing classes , other resources. available, @ compile time , @ runtime, library (the jar file) must present in classpath.
imports have nothing libraries. imports used allow source code use short class names instead of qualified names. example, being able code
list<string> list = new arraylist<string>();
instead of
java.util.list<string> list = new java.util.arraylist<string>();
whether use import or use qualified name, java compiler or java runtime must able find class in classpath. if class part of library, library must in classpath.
Comments
Post a Comment