Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Which is a more formal way of importing packages and classes as JavaScript objects?

a) import(java.util.*);
b) importClass(java.util.*);
c) import.Class(java.util.*);
d) Class.import(java.util.*);

Answer: b
Explanation: Because packages and classes are represented as JavaScript objects, you can assign them to variables to give them shorter names. But you can also more formally import them, if you want to:
importClass(java.util.HashMap); // Same as : var HashMap = java.util.HashMap

Join The Discussion